Thought it was about time I updated this mod for 4.4
First, open up include/history-order.php. Find this code around line 56:
Code:
if (
in_array(
$mode,
array(
'invoice',
'label',
'history',
)
)
Replace with:
Code:
if (
in_array(
$mode,
array(
'invoice',
'label',
'history',
'packing',
)
)
Next, find this code around line 143:
Code:
} elseif ($mode == 'label') {
func_display('main/order_labels_print.tpl',$smarty);
replace with:
Code:
} elseif ($mode == 'label') {
func_display('main/order_labels_print.tpl',$smarty);
} elseif ($mode == 'packing') {
func_display('main/order_invoice_packing.tpl',$smarty);
Next, we add a new button to your admin area. Open up skin/common_files/main/history_order.tpl and look for this line of code around line 88:
Code:
<td class="ButtonsRowRight">
{if $order.status eq 'A' or $order.status eq 'P' or $order.status eq 'C'}
{assign var=bn_title value=$lng.lbl_print_receipt}
{else}
{assign var=bn_title value=$lng.lbl_print_invoice}
{/if}
{include file="buttons/button.tpl" button_title=$bn_title target="_blank" href="order.php?orderid=`$order.orderid`&mode=invoice" substyle="link"}
</td>
Add this immediately AFTER it:
Code:
<td class="ButtonsRowRight">
{include file="buttons/button.tpl" button_title="Print Packing Slip" target="_blank" href="order.php?orderid=`$order.orderid`&mode=packing" substyle="link"}
</td>
Next, create a template called order_invoice_packing.tpl (a simple text file) with the following code in it:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{strip}
{capture name=title}
{if $config.SEO.page_title_format eq "long_direct" or $config.SEO.page_title_format eq "short_direct"}
{section name=position loop=$location}
{if not %position.first%} :: {/if}
{$location[position].0|strip_tags|escape}
{/section}
{else}
{section name=position loop=$location step=-1}
{if not %position.first%} :: {/if}
{$location[position].0|strip_tags|escape}
{/section}
{/if}
{/capture}
{if $config.SEO.page_title_limit lte 0}
{$smarty.capture.title}
{else}
{$smarty.capture.title|replace:" ":" "|truncate:$config.SEO.page_title_limit|replace:" ":" "}
{/if}
{/strip}</title>
{include file="meta.tpl"}
<style type="text/css">
<!--
BODY {ldelim}
FONT-FAMILY: Verdana, Arial, Helvetica, Sans-serif;
FONT-SIZE: 11px;
MARGIN: 10px;
PADDING: 10px;
{rdelim}
-->
</style>
</head>
<body{$reading_direction_tag}>
{if $config.Appearance.print_orders_separated eq "Y"}
{assign var="separator" value="<div style='page-break-after: always;'><!--[if IE 7]><br style='height: 0px; line-height: 0px;' /><![endif]--></div>"}
{else}
{assign var="separator" value="<br /><hr size='1' noshade='noshade' /><br />"}
{/if}
{section name=oi loop=$orders_data}
{include file="mail/html/order_invoice_packing.tpl" order=$orders_data[oi].order customer=$orders_data[oi].customer products=$orders_data[oi].products giftcerts=$orders_data[oi].giftcerts}
{if not %oi.last%}
{$separator}
{/if}
{/section}
</body>
</html>
Upload it to the skin/common_files/main/ folder.
Create a new language variable in your 'languages' area of the admin called txt_thank_you_for_purchase_packing. This will be the 'thank you message' at the bottom of the packing slip so that you can have a different one for packing and the invoice.
Finally, you need to upload the two attached files into the skin/common_files/mail/html folder. They are the packing slip and order data display. Note these are customized by me, so you'll want to tweak to your specs.
Enjoy!