Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add Field to Invoice


Guest

Recommended Posts

Posted

Hi Guys

 

I'm having problems getting the invoice and packing slip to display an additional field from the products table. I have inserted a field called "author" into the products table and have it displaying everywhere else. But i can't get it to display on the invoice. Can anyone help me out?

 

Thanks

Posted

To display somethng on the invoice, you need to add it to the orders "class".

 

See the this-> arrays in admin/includes/classes/order.php

Posted

Hi Burt

 

Yeah i tried that

 

admin/includes/classes/order.php

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

$index = 0;

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

while ($orders_products = tep_db_fetch_array($orders_products_query)) {

$this->products[$index] = array('qty' => $orders_products['products_quantity'],

'name' => $orders_products['products_name'],

'model' => $orders_products['products_model'],

'author' => $orders_products['products_author'],

'tax' => $orders_products['products_tax'],

'price' => $orders_products['products_price'],

'final_price' => $orders_products['final_price']);

 

$subindex = 0;

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

 

And the i called it in admin/invoice.php

 

<?php

for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {

echo ' <tr class="dataTableRow">' . "\n" .

' <td class="dataTableContent" valign="top" align="left">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .

' <td class="dataTableContent" valign="top" align="left">' . $order->products[$i]['name'] . '  <br>Author: ' . $order->$products[$i]['author'];

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

 

Any ideas what i have done wrong???

 

Thanks

Posted

But you are attempting to pull the "author" data from the TABLE_ORDER_PRODUCTS - can you see where you have gone wrong?

Posted
But you are attempting to pull the "author" data from the TABLE_ORDER_PRODUCTS - can you see where you have gone wrong?

so should i be writing it to the TABLE_ORDER_PRODUCTS first? Similar to name

Archived

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

×
×
  • Create New...