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
  #1  
Old 11-02-2006, 04:59 AM
 
balinor balinor is offline
 

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

Default Printable Packing Slip - 4.0.x

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.
Attached Files
File Type: zip templates.zip (2.4 KB, 537 views)
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
  #2  
Old 11-02-2006, 05:15 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default Re: Printable Packing Slip - 4.0.x

Thanks for this very usefull mod!
I'm certainly going to implement it soon.

Thanks again!
Jerrad
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
  #3  
Old 11-27-2006, 11:55 PM
 
hues hues is offline
 

Advanced Member
  
Join Date: Jul 2006
Posts: 90
 

Default Re: Printable Packing Slip - 4.0.x

Thank you for this very useful mod. I have added this mod to one of my website and it works perfectly. It will be wondeful if we have this mod for 4.1.3 too.

Thanks again.
__________________
X-Cart 4.4.5 ... www.drugteststrips.com
X-Cart 4.4.5 ... www.drugalcoholtest.com

Hues Technologies
http://www.huestechnologies.com
  #4  
Old 11-28-2006, 08:32 AM
 
Audiolines Audiolines is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 102
 

Default Re: Printable Packing Slip - 4.0.x

thanks, works well
__________________
version 4.0.17
  #5  
Old 11-30-2006, 07:24 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: Printable Packing Slip - 4.0.x

Thanks for this, nice addition to any website, I installed it within minutes on a client's website.
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
  #6  
Old 12-13-2006, 10:44 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Re: Printable Packing Slip - 4.0.x

I've tried this in 4.1.0 and the code in skin1/main/history_order.tpl needs a little changing:

After
{include file="buttons/button.tpl" button_title=$lng.lbl_print_invoice target="_blank" href="order.php?orderid=`$order.orderid`&mode=invo ice"}

I needed to put

<td class="ButtonsRow">

{include file="buttons/button.tpl" button_title="Print Packing Slip"
target="_blank"
href="order.php?orderid=`$order.orderid`&mode=pack ing"}

Putting <td class="ButtonsRow"> instead of <br>
__________________
X-Cart Gold Version 4.3.2
  #7  
Old 01-10-2007, 02:15 PM
 
starwest starwest is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 268
 

Default Re: Printable Packing Slip - 4.0.x

Has anyone sucessfully used this mod under v4.1.x? Is the above change all that is needed?

Has anyone used this to display credit card information on an admin invoice without having to allow credit card info to be sent via email? If so, are the included invoices already setup this way or would that require additional programming?
__________________
X-Cart Gold v4.1.10 [unix]
AOM, Special Offers, CDSEO Pro, Remember Anon Carts, Back-In-Stock Notifications, MM3, Feed Manager
  #8  
Old 01-10-2007, 02:44 PM
 
balinor balinor is offline
 

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

Default Re: Printable Packing Slip - 4.0.x

That is what I usually use it for...for clients who want to print out an invoice for their records with CC info on it.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
  #9  
Old 01-10-2007, 02:46 PM
 
starwest starwest is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 268
 

Default Re: Printable Packing Slip - 4.0.x

Are the attached templates already coded for this and do you have any idea if the posted change for v4.1.x works?
__________________
X-Cart Gold v4.1.10 [unix]
AOM, Special Offers, CDSEO Pro, Remember Anon Carts, Back-In-Stock Notifications, MM3, Feed Manager
  #10  
Old 01-10-2007, 02:51 PM
 
balinor balinor is offline
 

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

Default Re: Printable Packing Slip - 4.0.x

No, you would need to edit the template to show CC info. And sorry, not working with 4.1 yet.
__________________
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 12:31 AM.

   

 
X-Cart forums © 2001-2020