Guest Posted February 5, 2005 Share Posted February 5, 2005 Great! I guess that means that you got it all working the way you wanted it. Documenting things is, well, a chore sometimes, isn't it? -jared Link to comment Share on other sites More sharing options...
mmier Posted February 6, 2005 Share Posted February 6, 2005 Yes, got everything working great and have even added a few other fields and got them working also. My problem is I have to back track some to what I did prior to requesting help to make it a complete contribution. But it?ll be there sooner or later to help others as well. Miz --------------------- Contributions New Fields with Easy Populate Remove Category Images Link to comment Share on other sites More sharing options...
EvaFog Posted March 3, 2006 Share Posted March 3, 2006 Very cool script! I was really happy that you placed images of the finished result. Could you do that with the last change since Im more visual and I dont wanna change things if im not sure of the result:) Link to comment Share on other sites More sharing options...
essami Posted October 6, 2006 Share Posted October 6, 2006 Is there a way to add the order number in orders.php (I assume) So when you go and view orders instead of Customers Order Total Date Purchased Status Action It would read: Order number Customers Order Total Date Purchased Status Action Thanks! Sami Link to comment Share on other sites More sharing options...
Guest Posted October 22, 2006 Share Posted October 22, 2006 Sami, Look in admin/orders.php for the SQL queries. orders_id should already be included. Next, look for where the column headings are set up. You'll need to add one for the Orders ID field. Next, look a little further on down the file for a loop (a while or a foreach loop, I believe, that prints one single line of data. It will be in exactly the same order that data gets printed out when you view admin/orders.php. Add a new line, just like the others that are already there, but that shows the order id instead of the order total or customer name. If you get stuck, post back here, but I think you can figure it out with a little patience. -jared Link to comment Share on other sites More sharing options...
kkndkknd Posted December 22, 2006 Share Posted December 22, 2006 Thank you for the works. Link to comment Share on other sites More sharing options...
WGrace1 Posted May 9, 2007 Share Posted May 9, 2007 This thread has been awesome - has helped me out - so thanks to all who have posted. My question is can I include customer comments on the invoice along with an answer to the comment as needed. ~grace~ Link to comment Share on other sites More sharing options...
Guest Posted September 6, 2007 Share Posted September 6, 2007 Thanks Jarad, I always wanted that and wondered why it was left off of the invoices. I added a new row below that row and made it a smaller font, I also removed the </a> and </font>. <tr> <td align="right" colspan="2">Order #<?php echo $oID;?> </td> </tr> I'm not sure any reply to this question. Ans: You have no need to insert <tr> tag, only <td> is to be input. Link to comment Share on other sites More sharing options...
stickypod Posted October 18, 2007 Share Posted October 18, 2007 I'm trying to display a customers ID on their packing slip and I need to know how to extract this data from the MySQL database. Please be specific. Thank you, Tom Anyone can buy a camera... it's what you do with it that counts! Sticky Pod www.stickypod.com Link to comment Share on other sites More sharing options...
stickypod Posted October 19, 2007 Share Posted October 19, 2007 I'm trying to display a customers ID on their packing slip and I need to know how to extract this data from the MySQL database. Please be specific. Thank you, Tom I worked out the answer with the help of BeauCowan in the General Support section, moderators please remove this post. Thank you. Anyone can buy a camera... it's what you do with it that counts! Sticky Pod www.stickypod.com Link to comment Share on other sites More sharing options...
blue9 Posted November 4, 2007 Share Posted November 4, 2007 I have followed the instructions here and have got a better looking Invoice thank you very much...Only the border on the right side is not working. (see pic ) Thanks for any help. Ok, here are copies of my invoice.php and packingslip.php Make a backup of yours FIRST! Try replacing yours with the code below. You will need to change the logo to match yours. Search for the file name pop-the-top4.png and change the name and size to match your store logo. Also, You will need to add your site name and domain address. Search for YOUR SITE NAME and YOURDOMAIN and change it to match yours. <span style='font-size:14pt;line-height:100%'><span style='color:red'>INVOICE.PHP</span></span> <?php /* $Id: invoice.php,v 1.6 2003/06/20 00:37:30 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); include(DIR_WS_CLASSES . 'order.php'); $order = new order($oID); $date = date('M d, Y'); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <title>Order Invoice #04-<?php echo $oID; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- body_text //--> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="left"><img src="/images/pop-the-top4.png" border="0" width="166" height="54" alt=""></td> <TD ALIGN="right" VALIGN="top"><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong>Invoice # 04-<?php echo $oID; ?><BR><?php echo $date; ?></strong></font></TD> </tr> <tr> <td colspan="2"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <TD ALIGN="right" COLSPAN="2"><span class="pageHeadingSM"><FONT FACE="Verdana" SIZE="1" COLOR="#006699"><strong><?php echo nl2br(STORE_NAME_ADDRESS); ?></strong></font></span></TD> </tr> <tr> <TD> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="4"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="10%"><hr size="2"></td> <td align="center" class="pageHeading"><em><b>Invoice</b></em></td> <td width="100%"><hr size="2"></td> </tr> </table> </td> </tr> <tr> <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100', '5'); ?></td> </tr> <tr> <td width="3"> </td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="../images/borders/maingrey_01.gif" width="11" height="16" alt=""></td> <td background="../images/borders/maingrey_02.gif"><img src="../images/borders/maingrey_02.gif" width="24" height="16" alt="" ></td> <td width="19"><img src="../images/borders/maingrey_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="../images/borders/maingrey_04.gif"><img src="../images/borders/maingrey_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#F2F2F2"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="main"> <tr> <td align="left" valign="top"><b><?php echo ENTRY_SOLD_TO; ?></b></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td> <?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br> '); ?></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td> <?php echo $order->customer['telephone']; ?></td> </tr> <tr> <td> <?php echo $order->customer['email_address']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="../images/borders/maingrey_06.gif"><img src="../images/borders/maingrey_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="../images/borders/maingrey_07.gif" width="11" height="18" alt=""></td> <td background="../images/borders/maingrey_08.gif"><img src="../images/borders/maingrey_08.gif" width="24" height="18" alt=""></td> <td><img src="../images/borders/maingrey_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> <td width="45"> </td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="../images/borders/mainwhite_01.gif" width="11" height="16" alt=""></td> <td background="../images/borders/mainwhite_02.gif"><img src="../images/borders/mainwhite_02.gif" width="24" height="16" alt=""></td> <td width="19"><img src="../images/borders/mainwhite_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="../images/borders/mainwhite_04.gif"><img src="../images/borders/mainwhite_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td align="left" valign="top"><b><?php echo ENTRY_SHIP_TO; ?></b></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td> <?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br> '); ?></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="../images/borders/mainwhite_06.gif"><img src="../images/borders/mainwhite_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="../images/borders/mainwhite_07.gif" width="11" height="18" alt=""></td> <td background="../images/borders/mainwhite_08.gif"><img src="../images/borders/mainwhite_08.gif" width="24" height="18" alt=""></td> <td><img src="../images/borders/mainwhite_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> </tr> </table> </TD> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '100', '15'); ?></td> </tr> <tr> <TD COLSPAN="2"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="9"> </td> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="../images/borders/maingrey_01.gif" width="11" height="16" alt=""></td> <td background="../images/borders/maingrey_02.gif"><img src="../images/borders/maingrey_02.gif" width="24" height="16" alt="" ></td> <td width="19"><img src="../images/borders/maingrey_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="../images/borders/maingrey_04.gif"><img src="../images/borders/maingrey_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#F2F2F2"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td width="33%"> <b>Order #:</b> <?php echo tep_db_input($oID); ?></td> <td width="33%"> <b>Date of Order: </b><?php echo tep_date_short($order->info['date_purchased']); ?></td> <td> <b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="../images/borders/maingrey_06.gif"><img src="../images/borders/maingrey_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="../images/borders/maingrey_07.gif" width="11" height="18" alt=""></td> <td background="../images/borders/maingrey_08.gif"><img src="../images/borders/maingrey_08.gif" width="24" height="18" alt=""></td> <td><img src="../images/borders/maingrey_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <TD COLSPAN="2"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td> <td WIDTH="80" class="dataTableHeadingContent">SKU #</td> <td WIDTH="80" class="dataTableHeadingContent" align="right">Unit Price</td> <TD WIDTH="80" ALIGN="right" CLASS="dataTableHeadingContent">Total</TD> </tr> <?php 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']; if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) { for ($j = 0; $j < $k; $j++) { echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']; if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; echo '</i></small></nobr>'; } } echo ' </td>' . "\n" . ' <td WIDTH="80" class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n"; echo ' <td WIDTH="80" class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" . ' <td WIDTH="80" class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n"; echo ' </tr>' . "\n"; } ?> <tr> <td align="right" colspan="5"><table border="0" cellspacing="0" cellpadding="2"> <?php for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { echo ' <tr>' . "\n" . ' <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" . ' <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table> </td> </tr> </table></td> </tr> </table> <!-- body_text_eof //--> <P> </P> <P> </P> <CENTER><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong>Thank you for shopping at<BR>YOUR SITE NAME<BR>http://www.YOURDOMAIN.com</strong></font></CENTER> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> <span style='font-size:14pt;line-height:100%'><span style='color:red'>PACKINGSLIP.PHP</span></span> <?php /* $Id: packingslip.php,v 1.7 2003/06/20 00:40:10 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); include(DIR_WS_CLASSES . 'order.php'); $order = new order($oID); $date = date('M d, Y'); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title>Order Packing Slip - #04-<?php echo $oID; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- body_text //--> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="left"><img src="/images/pop-the-top4.png" border="0" width="166" height="54" alt=""></td> <TD ALIGN="right" VALIGN="top"><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong>Invoice # 04-<?php echo $oID; ?><BR><?php echo $date; ?></strong></font></TD> </tr> <tr> <td colspan="2"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <TD ALIGN="right" COLSPAN="2"><span class="pageHeadingSM"><FONT FACE="Verdana" SIZE="1" COLOR="#006699"><strong><?php echo nl2br(STORE_NAME_ADDRESS); ?></strong></font></span></TD> </tr> <tr> <TD> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="4"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="10%"><hr size="2"></td> <td align="center" nowrap class="pageHeading"><em><b>Packing Slip</b></em></td> <td width="100%"><hr size="2"></td> </tr> </table> </td> </tr> <tr> <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100', '5'); ?></td> </tr> <tr> <td width="3"> </td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="../images/borders/maingrey_01.gif" width="11" height="16" alt=""></td> <td background="../images/borders/maingrey_02.gif"><img src="../images/borders/maingrey_02.gif" width="24" height="16" alt="" ></td> <td width="19"><img src="../images/borders/maingrey_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="../images/borders/maingrey_04.gif"><img src="../images/borders/maingrey_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#F2F2F2"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="main"> <tr> <td align="left" valign="top"><b><?php echo ENTRY_SOLD_TO; ?></b></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td> <?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br> '); ?></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td> <?php echo $order->customer['telephone']; ?></td> </tr> <tr> <td> <?php echo $order->customer['email_address']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="../images/borders/maingrey_06.gif"><img src="../images/borders/maingrey_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="../images/borders/maingrey_07.gif" width="11" height="18" alt=""></td> <td background="../images/borders/maingrey_08.gif"><img src="../images/borders/maingrey_08.gif" width="24" height="18" alt=""></td> <td><img src="../images/borders/maingrey_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> <td width="45"> </td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="../images/borders/mainwhite_01.gif" width="11" height="16" alt=""></td> <td background="../images/borders/mainwhite_02.gif"><img src="../images/borders/mainwhite_02.gif" width="24" height="16" alt=""></td> <td width="19"><img src="../images/borders/mainwhite_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="../images/borders/mainwhite_04.gif"><img src="../images/borders/mainwhite_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td align="left" valign="top"><b><?php echo ENTRY_SHIP_TO; ?></b></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td> <?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br> '); ?></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="../images/borders/mainwhite_06.gif"><img src="../images/borders/mainwhite_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="../images/borders/mainwhite_07.gif" width="11" height="18" alt=""></td> <td background="../images/borders/mainwhite_08.gif"><img src="../images/borders/mainwhite_08.gif" width="24" height="18" alt=""></td> <td><img src="../images/borders/mainwhite_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> </tr> </table> </TD> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '100', '15'); ?></td> </tr> <tr> <TD COLSPAN="2"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="9"> </td> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="../images/borders/maingrey_01.gif" width="11" height="16" alt=""></td> <td background="../images/borders/maingrey_02.gif"><img src="../images/borders/maingrey_02.gif" width="24" height="16" alt="" ></td> <td width="19"><img src="../images/borders/maingrey_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="../images/borders/maingrey_04.gif"><img src="../images/borders/maingrey_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#F2F2F2"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td width="33%"> <b>Order #:</b> <?php echo tep_db_input($oID); ?></td> <td width="33%"> <b>Date of Order: </b><?php echo tep_date_short($order->info['date_purchased']); ?></td> <td> <b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="../images/borders/maingrey_06.gif"><img src="../images/borders/maingrey_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="../images/borders/maingrey_07.gif" width="11" height="18" alt=""></td> <td background="../images/borders/maingrey_08.gif"><img src="../images/borders/maingrey_08.gif" width="24" height="18" alt=""></td> <td><img src="../images/borders/maingrey_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <TD COLSPAN="2"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td> <td WIDTH="80" class="dataTableHeadingContent">SKU #</td> </tr> <?php 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']; if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) { for ($j=0, $k=sizeof($order->products[$i]['attributes']); $j<$k; $j++) { echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']; echo '</i></small></nobr>'; } } echo ' </td>' . "\n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table> </td> </tr> </table> </td> </tr> </table> <!-- body_text_eof //--> <P> </P> <P> </P> <CENTER><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong>YOUR SITE NAME<BR>http://www.YOURDOMAIN.com</strong></font></CENTER> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Now, download the below images and upload them to your http://www.YOURDOMAIN.com/catalog/images/borders folder. Just right-click on them, choose Save picture as. You must keep the same directory structure shown below for the images/border folder. Hope this works for you... I do not thnk that I have any other mods installed in the invoicephp or packingslip.php so a direct replacement of yours should work fine. Let me know if it works for you! Link to comment Share on other sites More sharing options...
oxfamire Posted November 12, 2007 Share Posted November 12, 2007 Hi all Thanks for this thread, it's been really useful. I just have one more query - our customers often include gift messages or directions to their houses etc in the comments field, but that's currently not showing up on our packing slips. How do I add this field to the packing slip? Thanks OxfamIreland Link to comment Share on other sites More sharing options...
Car Care Direct Posted December 28, 2007 Share Posted December 28, 2007 slight update: I decided I wanted to put both the "orderered" and "invoiced' dates in there, so I couldn't just have today's date. change the beginning of the file to look like this (the rest of the file is stock): <?php /* $Id: invoice.php,v 1.6 2003/06/20 00:37:30 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); $order = tep_db_query("select orders_id, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $order_query = tep_db_fetch_array($order); include(DIR_WS_CLASSES . 'order.php'); $order = new order($oID); $date = date('m/d/Y'); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- body_text //--> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td> <td class="pageHeading" align="right">Order #<?php echo $oID;?> <br><font size="2">Order Placed <?php echo tep_date_short($order_query['date_purchased']); ?> <br>Final Invoice <?php echo $date; ?> </td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . STORE_LOGO, STORE_NAME); ?></td> </tr> </table></td> </tr> If you don't like your store image in the invoice (I don't), then change this line: <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . STORE_LOGO, STORE_NAME); ?></td> to: <!-- <td class="pageHeading" align="right">//<?php echo tep_image(DIR_WS_IMAGES . STORE_LOGO, STORE_NAME); ?></td> --> -jared Very helpful post i have just updated my files with the above code. Just two questions. How do i change my font size on my shop address. Also when i play with the following line $date = date('m/d/Y'); That just seems to change the format of the final invoice date. What changes the format of the order placed date. Cheers Dave Link to comment Share on other sites More sharing options...
Stroker396 Posted March 7, 2009 Share Posted March 7, 2009 didn't it used to be you could subscribe to t thread under options without having to post? I am looking for one thing and keep getting distracted by all these other add ons that will be useful later. The Site can be viewed at www.performanceautopartsonline.com The site is live (despite these minor glitches) please respect that and do not sign up etc... maybe a contribution one day when I get this site the way I want it. I don't make spelling mistakes! I have dyslecsic fingers. Link to comment Share on other sites More sharing options...
Guest Posted June 12, 2009 Share Posted June 12, 2009 Hello, I've been looking for a mod... I use the pay on delivery method so I need to put on the packing slip the total amount that the customer has to pay. I've tried so far but I can't get only the total amount. $order->totals[$i]['text'] gives the whole list of totals. Is there any way of doing that? Thank you very much. Regards Link to comment Share on other sites More sharing options...
Guest Posted June 12, 2009 Share Posted June 12, 2009 Did it on my own. Please corect me if i'm wrong. Here is the code: <?php $result = tep_db_query("select text from orders_total where orders_id = '" . (int)$oID . "'and class='ot_total'"); while($row = mysql_fetch_array($result)) { echo "<table align='center'>" . $row['text']. "</table>"; } ?> It returns the whole amount to be paid (price + tax + shipping) Link to comment Share on other sites More sharing options...
Solan Posted September 23, 2009 Share Posted September 23, 2009 Hi all, thanks for this superb thread. I would like to add a text at the top ABOVE all of the other information in the invoice.. where do i put that so it centers at in the top of the page? :rolleyes: Link to comment Share on other sites More sharing options...
Solan Posted September 24, 2009 Share Posted September 24, 2009 Ok, here are copies of my invoice.php and packingslip.php Make a backup of yours FIRST! Try replacing yours with the code below. You will need to change the logo to match yours. Search for the file name pop-the-top4.png and change the name and size to match your store logo. Also, You will need to add your site name and domain address. Search for YOUR SITE NAME and YOURDOMAIN and change it to match yours. <span style='font-size:14pt;line-height:100%'>INVOICE.PHP</span> <?php /* $Id: invoice.php,v 1.6 2003/06/20 00:37:30 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); include(DIR_WS_CLASSES . 'order.php'); $order = new order($oID); $date = date('M d, Y'); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <title>Order Invoice #04-<?php echo $oID; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- body_text //--> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="left"><img src="/images/pop-the-top4.png" border="0" width="166" height="54" alt=""></td> <TD ALIGN="right" VALIGN="top"><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong>Invoice # 04-<?php echo $oID; ?><BR><?php echo $date; ?></strong></font></TD> </tr> <tr> <td colspan="2"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <TD ALIGN="right" COLSPAN="2"><span class="pageHeadingSM"><FONT FACE="Verdana" SIZE="1" COLOR="#006699"><strong><?php echo nl2br(STORE_NAME_ADDRESS); ?></strong></font></span></TD> </tr> <tr> <TD> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="4"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="10%"><hr size="2"></td> <td align="center" class="pageHeading"><em><b>Invoice</b></em></td> <td width="100%"><hr size="2"></td> </tr> </table> </td> </tr> <tr> <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100', '5'); ?></td> </tr> <tr> <td width="3"> </td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="../images/borders/maingrey_01.gif" width="11" height="16" alt=""></td> <td background="../images/borders/maingrey_02.gif"><img src="../images/borders/maingrey_02.gif" width="24" height="16" alt="" ></td> <td width="19"><img src="../images/borders/maingrey_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="../images/borders/maingrey_04.gif"><img src="../images/borders/maingrey_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#F2F2F2"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="main"> <tr> <td align="left" valign="top"><b><?php echo ENTRY_SOLD_TO; ?></b></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td> <?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br> '); ?></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td> <?php echo $order->customer['telephone']; ?></td> </tr> <tr> <td> <?php echo $order->customer['email_address']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="../images/borders/maingrey_06.gif"><img src="../images/borders/maingrey_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="../images/borders/maingrey_07.gif" width="11" height="18" alt=""></td> <td background="../images/borders/maingrey_08.gif"><img src="../images/borders/maingrey_08.gif" width="24" height="18" alt=""></td> <td><img src="../images/borders/maingrey_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> <td width="45"> </td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="../images/borders/mainwhite_01.gif" width="11" height="16" alt=""></td> <td background="../images/borders/mainwhite_02.gif"><img src="../images/borders/mainwhite_02.gif" width="24" height="16" alt=""></td> <td width="19"><img src="../images/borders/mainwhite_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="../images/borders/mainwhite_04.gif"><img src="../images/borders/mainwhite_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td align="left" valign="top"><b><?php echo ENTRY_SHIP_TO; ?></b></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td> <?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br> '); ?></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="../images/borders/mainwhite_06.gif"><img src="../images/borders/mainwhite_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="../images/borders/mainwhite_07.gif" width="11" height="18" alt=""></td> <td background="../images/borders/mainwhite_08.gif"><img src="../images/borders/mainwhite_08.gif" width="24" height="18" alt=""></td> <td><img src="../images/borders/mainwhite_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> </tr> </table> </TD> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '100', '15'); ?></td> </tr> <tr> <TD COLSPAN="2"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="9"> </td> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="11"><img src="../images/borders/maingrey_01.gif" width="11" height="16" alt=""></td> <td background="../images/borders/maingrey_02.gif"><img src="../images/borders/maingrey_02.gif" width="24" height="16" alt="" ></td> <td width="19"><img src="../images/borders/maingrey_03.gif" width="19" height="16" alt=""></td> </tr> <tr> <td background="../images/borders/maingrey_04.gif"><img src="../images/borders/maingrey_04.gif" width="11" height="21" alt=""></td> <td align="center" bgcolor="#F2F2F2"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main"> <tr> <td width="33%"> <b>Order #:</b> <?php echo tep_db_input($oID); ?></td> <td width="33%"> <b>Date of Order: </b><?php echo tep_date_short($order->info['date_purchased']); ?></td> <td> <b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td> </tr> </table> </td> <td background="../images/borders/maingrey_06.gif"><img src="../images/borders/maingrey_06.gif" width="19" height="21" alt=""></td> </tr> <tr> <td><img src="../images/borders/maingrey_07.gif" width="11" height="18" alt=""></td> <td background="../images/borders/maingrey_08.gif"><img src="../images/borders/maingrey_08.gif" width="24" height="18" alt=""></td> <td><img src="../images/borders/maingrey_09.gif" width="19" height="18" alt=""></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td> </tr> <tr> <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <TD COLSPAN="2"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td> <td WIDTH="80" class="dataTableHeadingContent">SKU #</td> <td WIDTH="80" class="dataTableHeadingContent" align="right">Unit Price</td> <TD WIDTH="80" ALIGN="right" CLASS="dataTableHeadingContent">Total</TD> </tr> <?php 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']; if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) { for ($j = 0; $j < $k; $j++) { echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']; if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; echo '</i></small></nobr>'; } } echo ' </td>' . "\n" . ' <td WIDTH="80" class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n"; echo ' <td WIDTH="80" class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" . ' <td WIDTH="80" class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n"; echo ' </tr>' . "\n"; } ?> <tr> <td align="right" colspan="5"><table border="0" cellspacing="0" cellpadding="2"> <?php for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { echo ' <tr>' . "\n" . ' <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" . ' <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table> </td> </tr> </table></td> </tr> </table> <!-- body_text_eof //--> <P> </P> <P> </P> <CENTER><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong>Thank you for shopping at<BR>YOUR SITE NAME<BR>http://www.YOURDOMAIN.com</strong></font></CENTER> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> [/code] Now, download the below images and upload them to your http://www.YOURDOMAIN.com/catalog/images/borders folder. Just right-click on them, choose Save picture as. You must keep the same directory structure shown below for the images/border folder. Hope this works for you... I do not thnk that I have any other mods installed in the invoicephp or packingslip.php so a direct replacement of yours should work fine. Let me know if it works for you! Hi again, is it just me or why dont i find the mainwhite gif´s ? You have them in the code but i only see your gif´s with maingrey???? Link to comment Share on other sites More sharing options...
Solan Posted September 24, 2009 Share Posted September 24, 2009 Hi again, is it just me or why dont i find the mainwhite gif´s ? You have them in the code but i only see your gif´s with maingrey???? I found them in a package for this contrib.. Now i wonder why everything looks ok in my computer but when i print it the grey background color doesnt show.. :blush: Any ideas? Link to comment Share on other sites More sharing options...
losangelescarrental Posted December 16, 2009 Share Posted December 16, 2009 Nice job, a good help. Thanks Link to comment Share on other sites More sharing options...
Guest Posted February 28, 2010 Share Posted February 28, 2010 I found them in a package for this contrib.. Now i wonder why everything looks ok in my computer but when i print it the grey background color doesnt show.. :blush: Any ideas? Same problem here.. Looks great on the screen but when printed... Borders don't complete and not greyed in...????? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.