Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Printable Packing Slip - 4.0.x

 
Closed Thread
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #101  
Old 08-25-2011, 01:05 AM
 
imageizeverything imageizeverything is offline
 

eXpert
  
Join Date: Mar 2005
Location: Manhattan, New York City
Posts: 250
 

Question Re: Printable Packing Slip - 4.0.x

Quote:
Originally Posted by balinor
Many of our clients want to offer a completely different version of the invoice as a packing slip, often with no prices shown. This mod will create another button on the admin order page, as well as a new invoice template which you can alter to your liking. This code is for 4.0.18, but should work on any of the 4.0.x versions. It probably WILL NOT work on 4.1.

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:
{include file="buttons/button.tpl" button_title=$lng.lbl_print_invoice target="_blank" href="order.php?orderid=`$order.orderid`&mode=invoice"}

Just after it, add this:
Code:
<br>{if $usertype ne "C"} {include file="buttons/button.tpl" button_title="Print Packing Slip" target="_blank" href="order.php?orderid=`$order.orderid`&mode=packing"}{/if}

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>

Next, we need to create the unique invoice template and data template. Extract the two files in the attached zip, and upload them to the skin1/mail/html folder.

That should do it. Edit order_invoice_packing.tpl and order_data_packing.tpl to achieve the look/data display you are looking for. This order_data_packing.tpl does not include pricing information. If you would like to add that back in, simply copy the contents of order_data.tpl into order_data_packing.tpl. Let me know if you have any issues.

Hi balinor. Thank you for taking the time to put this together.
I have a question: Is this solution compatible with x-cart gold v4.4.3 ?
__________________
Using
*Upgrading Dev Copy of 4.4.3 to 4.6.3 (currently at 4.5.4)
X-Cart Gold Version 4.6.3 (Fresh Install)
X-Cart Gold Version 4.4.4
X-Cart Gold Version 4.4.3
Godaddy Shared Linux Hosting
PHP 5.3.24
MySQL server 5.5.33-log
MySQL client 5.5.19
-----------------------------------------------
  #102  
Old 08-25-2011, 08:36 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Printable Packing Slip - 4.0.x

Updated for 4.4 here:

http://forum.x-cart.com/showthread.php?t=60671
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development

The following user thanks balinor for this useful post:
imageizeverything (08-25-2011)
  #103  
Old 08-25-2011, 09:32 AM
 
imageizeverything imageizeverything is offline
 

eXpert
  
Join Date: Mar 2005
Location: Manhattan, New York City
Posts: 250
 

Thumbs up Re: Printable Packing Slip - 4.0.x

Quote:
Originally Posted by balinor

Thanks a Million! So the only instructions I need to make it work for 4.4.3 is at that new thread?
__________________
Using
*Upgrading Dev Copy of 4.4.3 to 4.6.3 (currently at 4.5.4)
X-Cart Gold Version 4.6.3 (Fresh Install)
X-Cart Gold Version 4.4.4
X-Cart Gold Version 4.4.3
Godaddy Shared Linux Hosting
PHP 5.3.24
MySQL server 5.5.33-log
MySQL client 5.5.19
-----------------------------------------------
  #104  
Old 08-25-2011, 09:57 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Printable Packing Slip - 4.0.x

Correct.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Closed Thread
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:16 AM.

   

 
X-Cart forums © 2001-2020