osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 01-16-2007, 02:59 PM
New Member
 
Join Date: Jan 2007
Posts: 11
Thanks: 2
Thanked 2 Times in 2 Posts
Rep Power: 0
aeava is on a distinguished road
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.-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2  
Old 01-16-2007, 03:33 PM
New Member
 
Join Date: Jan 2007
Posts: 11
Thanks: 2
Thanked 2 Times in 2 Posts
Rep Power: 0
aeava is on a distinguished road
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.-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 06:26 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax