Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add Manufacturer to Order Confirmation Email


Guest

Recommended Posts

I posted this question before on an existing thread, but haven't had any responces. I hope this doesn't count as a double post.

 

I'd like to add the Manufacturer to the order confirmation email. I have applied some code I found in my search for an answer (http://www.oscommerce.com/forums/index.php?act=ST&f=11&t=39738), but I'm still not quite there yet.

 

This is what I have done so far:

 

In catalog/includes/classes/order.php

Coment:

// $orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

 

and replace by:

$orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

 

and then

// This is a new code line

                                       'manufacturer_product_id' => $orders_products['products_id'],

 

In catalog/checkout_process.php

Coment:

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

 

Replace with:

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

 

In catalog/includes/functions/general.php

Add:

function tep_get_products_manufacturer($product_id) {

$products_manufacturer_query = tep_db_query("SELECT manufacturers_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . $product_id . "'");

$products_manufacturer = tep_db_fetch_array($products_manufacturer_query);

$manufacturer_query = tep_db_query("SELECT manufacturers_name FROM " . TABLE_MANUFACTURERS . " WHERE manufacturers_id = '" . $products_manufacturer['manufacturers_id'] . "'");

$manufacturer = tep_db_fetch_array($manufacturer_query);

return ($manufacturer['manufacturers_name'] == "" ? "N/A" : $manufacturer['manufacturers_name']);

}

 

When I do a test order I receive an email with:

Products

------------------------------------------------------

1 x Girls' All Occasion Footed Tights (N/A 51) = $2.93

Color Theatrical Pink

Size Medium

------------------------------------------------------

 

The N/A by the 51 is where the manufacturer's name should apear, but I don't know what else to do to make it work. Please help.

 

Erica

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...