Results 1 to 2 of 2

Add new field to product table

This is a discussion on Add new field to product table within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Hi, I've added a new field to the products table "products_bin". This is very similar to the "products_model" field. I ...

      
  1. #1
    New Member
    Join Date
    Jan 2007
    Posts
    11
    Rep Power
    0


    Default Add new field to product table

    Hi,

    I've added a new field to the products table "products_bin". This is very similar to the "products_model" field. I need it to appear on the e-mail confirmation. Can anyone help me?

    Looking at the checkout_process.php file, I've found the following line of code that creates the lines in the e-mail with the product details, so I've added the text in red:

    $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['bin'] . '/' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";


    I've also gone to the 'order.php' class file (includes\classes) and edited it so that every time there was an instance of "model", I added "bin".

    I've also added a field in the orders_products table named 'products_bin'.

    Anyone can help? Pleeease??

    thanks in advance,

    A.-

  2. #2
    New Member
    Join Date
    Jan 2007
    Posts
    11
    Rep Power
    0


    Default Re: Add new field to product table

    I couldn't get it to work "the right way", so I cheated and did the following:

    Filename: checkout_process.php
    Lines: around 288
    **new code in red **

    //request bin code
    $bins = tep_db_query("select products_bin from products where products_model='" . $order->products[$i]['model'] . "'");
    $bins_values = tep_db_fetch_array($bins);


    $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] .' (' . $bins_values['products_bin'] . '/' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";

    If anyone has got a nicer way of doing this, please let me know. don't want to have to run additional queries for each product ordered...



    A.-

Similar Threads

  1. Need to add input text field in product attributes
    By bethphilbin in forum osCommerce 2.2 Modification Help
    Replies: 15
    Last Post: 08-07-2006, 08:48 PM
  2. text field product option
    By esferguson in forum osCMax v1.7 General Mods Discussion
    Replies: 30
    Last Post: 06-10-2006, 09:58 AM
  3. How to change character limit in product name field
    By spiros71 in forum osCMax v2 Features Discussion
    Replies: 1
    Last Post: 06-08-2006, 08:39 AM
  4. HTML editor above product description field disapeared
    By winkscustoms in forum osCmax v1.7 Discussion
    Replies: 5
    Last Post: 06-17-2005, 08:36 PM
  5. Add new fields/table to product table
    By Anonymous in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 10-21-2002, 05:23 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •