Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add product category to invoive


tedhorn123

Recommended Posts

The page catalog/checkout_process.php sends the invoices to the customer as well as a copy to store owner.

You will need to insert a database query that compares the products_id to the category_id using the table products to categories.

 

Try it around line 262:

for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {

$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";

}

 

Use the class $order in the loop:

for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {

$products_id = tep_get_prid($order->products[$i]['id'])

$query = 'select category_id as id from ' . TABLE_PRODUCTS_TO_CATEGORIES . ' where products_id = ' . (int)$products_id);

$category = tep_db_fetch_array($query);

$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";

$email_order .= 'Category ID: ' . $category['id'] . "\n";

}

 

Please be advised that the above was off the top of my head. You may need to modify if errors occur.. But the general idea should work..

Lloyd

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...