I've made a few changes to this new Invoice code to create a printable Packing List. Works in 3.3.x Follow the steps below if you want to try it yourself.
Edit the xcart/include/history_order.php file and make the following changes:
At line 48:
Code:
if ($mode == "invoice" or $mode == "label") {
to:
Code:
if ($mode == "invoice" or $mode == "label" or $mode == "packing") {
And in the same file, make this small change at line 69:
Code:
if ($mode == "invoice")
$smarty->display("orders/order_invoice.tpl");
elseif ($mode == "label")
$smarty->display("main/order_labels_print.tpl");
$smarty->debugging = $_tmp_smarty_debug;
}
to:
Code:
if ($mode == "packing")
$smarty->display("orders/order_packing.tpl");
elseif ($mode == "invoice")
$smarty->display("orders/order_invoice.tpl");
elseif ($mode == "label")
$smarty->display("main/order_labels_print.tpl");
$smarty->debugging = $_tmp_smarty_debug;
}
Then create a file orders/order_packing.tpl by slightly modifying the order_invoice.tpl file. Essentially, just replicate the whole file, but change the include statement from file="orders/invoice.tpl" to file="orders/packingslip.tpl":
Code:
{* $Id: order_invoice_print.tpl,v 1.3.2.1 2002/11/01 09:19:29 alfiya Exp $ *}
{section name=oi loop=$orders_data}
{ include file="orders/packingslip.tpl" order=$orders_data[oi].order customer=$orders_data[oi].customer products=$orders_data[oi].products giftcerts=$orders_data[oi].giftcerts}
{/section}
Create the file orders/packingslip.tpl by (again) slightly modifying the invoice.tpl file to remove the prices, taxes, subtotals, etc. Here's an example. Modify it accordingly to include all your own store information:
Code:
<meta http-equiv="Content-Language" content="en-us">
<body topmargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" style="font-family: Courier New">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="600"
id="AutoNumber1" height="1">
<tr>
<td width="600">
<font face="Courier New" size="6"><center>YOUR STORE
PACKING SLIP</center></font></td>
</tr>
<tr>
<td height="1" nowrap>
<p style="margin-left: 5"><font size="2">Order date:</font><font size="2">
{$order.date|date_format:"%m/%d/%y %H:%M"}</font>
<font size="2">Order id: </font>
#{$order.orderid}
<font size="2">Shipping:
{include file="orders/include/shipping.tpl"}</font>
</p>
</p></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="600"
id="AutoNumber2" height="1">
<tr>
<td width="50%" style="border-left-width: 1; border-right-width: 1; border-top-style: solid; border-top-width: 3;
border-bottom-width: 1" bordercolor="#000000" height="1" rowspan="2">
<p style="margin-left: 5"><font size="2">
{$order.company}
{$order.firstname}{$order.lastname}
{$order.phone}
{$order.email}
</td>
<td width="100%" style="border-left-width: 1; border-right-width: 1; border-top-style: solid; border-top-width: 3;
border-bottom-width: 1" bordercolor="#000000" height="18">
<p align="right" style="margin-right: 5"><font size="2">YOUR ORDER INCLUDES THE ITEMS BELOW</font>
</td>
</tr>
<tr>
<td colspan="2" width="100%" style="border-left-width: 1; border-right-width: 1; border-bottom-width: 1" bordercolor="#000000"
height="1">
</td>
</tr>
<tr>
<td colspan="2">
<font size="1"><hr></font></td>
</tr>
<tr>
<td width="50%" style="border-left-width: 1; border-right-width: 1; border-bottom-width: 1" bordercolor="#000000"
height="19">
<p style="margin-left: 30"><font size="2">Bill to:</font></td>
<td width="50%" style="border-left-width: 1; border-right-width: 1; border-bottom-width: 1" bordercolor="#000000"
height="19">
<font size="2">Ship to:</font></td>
</tr>
<tr>
<td width="50%" bordercolor="#000000" height="1" valign="top">
<p style="margin-left: 45"><font size="2">{$order.firstname} {$order.lastname}</font><font size="2">
{$order.b_address}
{$order.b_city}, {$order.b_state} {$order.b_zipcode}</font></td>
<td width="50%" bordercolor="#000000" height="1" valign="top">
<p style="margin-left: 45"><font size="2">
{$order.firstname} {$order.lastname}
{$order.s_address}
{$order.s_city}, {$order.s_state} {$order.s_zipcode}
</font></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="600"
id="AutoNumber3" height="15">
<tr>
<td width="100%" style="border-top-style: solid; border-top-width: 1; border-bottom-style: solid;
border-bottom-width: 1" bgcolor="#E1E1E1" height="15">
<p align="center">Products Ordered
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="600"
id="AutoNumber4" height="1">
<tr>
<td width="10" height="1" style="border-left-width: 1; border-right-width: 1; border-top-width: 1;
border-bottom-style: dotted; border-bottom-width: 1"></td>
<td width="40" height="1" nowrap style="border-left-width: 1; border-right-width: 1; border-top-width: 1;
border-bottom-style: dotted; border-bottom-width: 1">
<p align="center" style="margin-left: 5; margin-right: 5"><font size="2">
Qty</font></td>
<td width="180" height="1" nowrap style="border-left-width: 1; border-right-width: 1; border-top-width: 1;
border-bottom-style: dotted; border-bottom-width: 1">
<p align="center" style="margin-left: 5; margin-right: 5"><font size="2">
SKU#</font></td>
<td width="370" height="1" nowrap style="border-left-width: 1; border-right-width: 1; border-top-width: 1;
border-bottom-style: dotted; border-bottom-width: 1">
<p align="center"><font size="2">Item Description</font></td>
</tr>
{include file="orders/include/packing_products.tpl"}
</tr>
<tr><td colspan="4"><hr></td></tr>
</table>
Next create the file orders/include/packing_products.tpl, which is a modified version of orders/include/products.tpl with the price information stripped out:
Code:
<tr>
<td colspan="6"></td>
</tr>
{section name=prod_num loop=$products}
<tr>
<td width="10" height="9"></td>
<td width="30" height="9">
<p align="center"><font size="2">{$products[prod_num].amount}</font></td>
<td width="180" nowrap height="9">
<p align="center"><font size="2">{$products[prod_num].productcode}</font></td>
<td width="380" height="9">
<p align="center"><font size="2">{$products[prod_num].product}</font></td>
</tr>
{/section}
<tr>
<td colspan="6"></td>
</tr>
Finally, change the main/history_order.tpl to include a link and for the Packing Slip in the Admin section. I put it right beside the 'Print Invoice' link and button, which looks like this:
I think we changed our buttons a while back, so watch that you get the right include statements for the buttons in your store.
This workss in version 3.3.1. I don't know if someone already posted a mod like this months (or years) ago, but since I can't find it searching the forums...
Oh, btw, thanks for all the great mods everyone!! I'm having a blast scanning through this forum and implementing a bunch of fun stuff![/code]