View Single Post
  #34  
Old 03-17-2008, 09:36 AM
 
samz724 samz724 is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 84
 

Thumbs up Re: Printable Packing Slip - 4.0.x

Quote:
Originally Posted by Keys Care
Hi All, I have been following this thread and I am excited that it now can work with batch and on 4.19. Could someone post the finished code and instructions. I am a little lost with all the discussion.

Thanks

Bob

I have version 4.1.8 and this worked perfectly for me:
(I followed much of the information from the beginning with a few modifications)

TAKEN FROM ORIGINAL POST
First, we need to add a new mode to order.php. To do this, we need to edit include/history_order.php:


FIND THIS:
Code:
if ($mode == "invoice" or $mode == "label")

REPLACE WITH THIS:
Code:
if ($mode == "invoice" or $mode == "label" or $mode == "packing")


FIND THIS:
Code:
if ($mode == "invoice") { if ($current_area == "A" || ($current_area == "P" && !empty($active_modules["Simple_Mode"]))) $smarty->assign("show_order_details", "Y"); func_display("main/order_invoice_print.tpl",$smarty); } elseif ($mode == "label") func_display("main/order_labels_print.tpl",$smarty); $smarty->debugging = $_tmp_smarty_debug; }

REPLACE WITH THIS:
Code:
if ($mode == "invoice") { if ($current_area == "A" || ($current_area == "P" && !empty($active_modules["Simple_Mode"]))) $smarty->assign("show_order_details", "Y"); func_display("main/order_invoice_print.tpl",$smarty); } elseif ($mode == "packing") func_display("main/order_packing_print.tpl",$smarty); elseif ($mode == "label") func_display("main/order_labels_print.tpl",$smarty); $smarty->debugging = $_tmp_smarty_debug; }



Next, we need to add a button to the order page of your admin area. Open skin1/main/history_order.tpl.

FIND THIS:
Code:
<td class="ButtonsRow">{include file="buttons/button.tpl" button_title=$lng.lbl_print_invoice target="_blank" href="order.php?orderid=`$order.orderid`&mode=invoice"}</td>

ADD THIS AFTER THE ABOVE:
Code:
<td class="ButtonsRow">{include file="buttons/button.tpl" button_title=$lng.lbl_print_packing target="_blank" href="order.php?orderid=`$order.orderid`&mode=packing"}</td>



Next, you will need to create a new label for the packing slip button:

1) Under the "Administration" heading on the admin side, select "Languages"
2) Under the "Edit language" heading, select "English"
3) Scroll to the bottom and add a new entry with the following information:
Variable: lbl_print_packing
Value: Print packing slip
4) Click add



Now we need to create the new templates we just called. In the skin1/main/ directory, create a template called order_packing_print.tpl. Put this code in it:

Code:
<HTML> <BODY> {if $config.Appearance.print_orders_separated eq "Y"} {assign var="separator" value="<DIV style='page-break-after:always'></DIV>"} {else} {assign var="separator" value="<br /><HR size='1' 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>


AT THIS POINT, YOU CAN CONTINUE TO FOLLOW THE ORIGINAL POST...
Next, we need to create the unique invoice template and data template. Extract the two files in the attached zip.....
__________________
Samz
--------------------------------------
Heavily modified
X-Cart Gold v4.1.10