Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Invoive/packing Slip Additions - Simple Echo Question


Guest

Recommended Posts

Posted

Hi All

 

I was wondering if anyone can tell me what the variable names are for the customer fax number and the shipping comments. I want to put them on the invoice and the packing slip.

 

For example, I have the customers phone number on the invoice/packing slip as:

echo $order->customer['telephone'];

 

I tried echo $order->customer['fax']; and that didnt work. Just looking for the right code.

 

Thanks in advance

-Jp

Posted

Fax and comments are not standard parts of the order class so can't be added in the way you are trying.

 

You will need to add a new query that gets the information that you want to then echo onto the invoice

 

Tom

Posted

I did this in catalog/admin/packingslip.php as the last item before the /body tag. You can add it below the last /table and before body_text_eof in the invoice .php file. It pulls all comments that were sent to the customer (customer_notified = 1)

 

</table>
<!--Comments  -->
<hr />
<strong>Comments:</strong><br />
<div class="main"><table border="0" cellspacing="0" cellpadding="5" width="75%">

<?php
$orders_history_query = tep_db_query("select date_added, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' and comments != '' and  customer_notified='1' order by date_added");
if (tep_db_num_rows($orders_history_query)) {
  while ($orders_history = tep_db_fetch_array($orders_history_query)) {
	echo '		  <tr valign="top">' . "\n" .
		 '			<td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
		 '			<td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .
		 '		  </tr>' . "\n";
  }
} else {
	echo '		  <tr>' . "\n" .
		 '			<td class="smallText" colspan="5">No Customer Comments</td>' . "\n" .
		 '		  </tr>' . "\n";
}
?>
	</table></div>
<!-- end of comments  -->

<!-- body_text_eof //-->

Archived

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

×
×
  • Create New...