Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Description on Invoices


Guest

Recommended Posts

Does anybody know how to put the product description onto invoices?

I've been on this for a couple of days now and my brain is beginning to hurt!!

I assumed it was simple (and probably is) but I just can't figure it out.

 

any help would be greatly appreciated

Link to comment
Share on other sites

In /catalog/admin/invoice.php around line 103 find

 

 

  for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
     echo '      <tr class="dataTableRow">' . "\n" .
          '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

 

and replace it with this.

 

 

  for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
  	 $product_description_query = "select products_id from " . TABLE_ORDERS_PRODUCTS . " where products_name = '" . $order->products[$i]['name'] . "' and orders_id = " . $oID;
  	 $product_description = tep_db_query($product_description_query);
  	 $product_description_array = tep_db_fetch_array($product_description);
  	 
     echo '      <tr class="dataTableRow">' . "\n" .
          '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'] . '<br>' . tep_get_products_description($product_description_array['products_id'], $languages_id) . '<br>';

while (!succeed) {try()};

 

GMT -6:00

Link to comment
Share on other sites

WOW! That worked a treat. Thank you very very much for your help, it is greatly appreciated.

 

Thank you again

Link to comment
Share on other sites

Hmm, having sorted out one issue thanks to Tom Thumb (many thanks), I am now presented with one that looks rather more of a problem to sort out...I have a feeling that its not possible at all ;-( .....but i'm not an expert in these matters!!

 

I would like to add the product category to the invoice, but I cant see where or how it is possible to match a product ID with its category. Is this a non-starter??

 

If anyone can shed some light it would be greatly appreciated - I notice that there are a couple of people on the forum looking for a way of doing this.

Link to comment
Share on other sites

Darren2509,

 

directly below the product_description_array statement add

 

$cat_id_query = "select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $product_description_array['products_id'];
$cat_id = tep_db_query($cat_id_query);
$cat_id_array = tep_db_fetch_array($cat_id);

 

the add this where you want to display the category name

 

echo tep_get_category_name($cat_id_array['categories_id'], $language_id);

while (!succeed) {try()};

 

GMT -6:00

Link to comment
Share on other sites

  • 1 year later...
Darren2509,

 

directly below the product_description_array statement add

 

$cat_id_query = "select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $product_description_array['products_id'];
$cat_id = tep_db_query($cat_id_query);
$cat_id_array = tep_db_fetch_array($cat_id);

 

the add this where you want to display the category name

 

echo tep_get_category_name($cat_id_array['categories_id'], $language_id);

 

Hi, I may be dumb.

what do the code of product_description_array statement look like, because I don't know where to insert the code.

 

Thank you.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...