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
  #31  
Old 02-21-2008, 07:21 PM
 
balinor balinor is offline
 

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

Default Re: Printable Packing Slip - 4.0.x

There was interest above, why don't you post the code?
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
  #32  
Old 02-22-2008, 05:23 AM
  Keys Care's Avatar 
Keys Care Keys Care is offline
 

eXpert
  
Join Date: Feb 2007
Location: Cheyenne - Santa Monica - Oregon
Posts: 214
 

Default Re: Printable Packing Slip - 4.0.x

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
__________________
All-Natural Healing Skin and Pet Care Products
4.6.0 Gold, ShipWorks 3
  #33  
Old 02-22-2008, 07:17 AM
 
chris.barber chris.barber is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 74
 

Default Re: Printable Packing Slip - 4.0.x

Pinestream that sounds great, I am very interested can you upload the code changes here as I know a couple of people were looking for this.

Thanks
__________________
Chris Barber
Version 4.1.9
MOD - BCSE Shipping Estimator
MOD - Shopzilla Feed
MOD - Price Match with Captcha
MOD - Links Manager 2008
MOD - One Page Checkout
MOD - Sitemap
  #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
  #35  
Old 03-17-2008, 09:46 AM
 
samz724 samz724 is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 84
 

Exclamation Re: Printable Packing Slip - 4.0.x

I second the batch modification. Please let us know..

Thanks!

Quote:
Originally Posted by chris.barber
Pinestream that sounds great, I am very interested can you upload the code changes here as I know a couple of people were looking for this.

Thanks
__________________
Samz
--------------------------------------
Heavily modified
X-Cart Gold v4.1.10
  #36  
Old 03-17-2008, 11:47 PM
 
chris.barber chris.barber is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 74
 

Default Re: Printable Packing Slip - 4.0.x

OK, I finally spent some time looking at this because it really needs to be done to make this the really worthwhile mod it is.

So got 20 mins to look at it today.

First create a label called lbl_packing_for_selected and enter the text as Print packing slips for selected.


Then edit the /include/process_order.php


Find

Quote:

#
# Display labels
#
$orders_to_delete = (!empty($orderids) ? $orderids : "");
func_header_location("process_order.php?mode=label ");
}

and immediately below it copy and paste

Quote:

elseif ($mode == "packing" and !empty($orderids)) {
#
# Display packing slips
#
$orders_to_delete = (!empty($orderids) ? $orderids : "");
func_header_location("process_order.php?mode=packi ng");
}

Then edit /skin1/main/order_list.tpl

Find

Quote:

<input type="button" value="{$lng.lbl_labels_for_selected|strip_tags:fa lse|escape}" onclick="javascript: if (checkMarks(this.form, new RegExp('orderids\[[0-9]+\]', 'gi'))) {ldelim} document.processorderform.target='labels'; submitForm(this, 'label'); document.processorderform.target=''; {rdelim}" />
&nbsp;&nbsp;&nbsp;&nbsp;

then immediately below it copy & paste

Quote:

<input type="button" value="{$lng.lbl_packing_for_selected|strip_tags:f alse|escape}" onclick="javascript: if (checkMarks(this.form, new RegExp('orderids\[[0-9]+\]', 'gi'))) {ldelim} document.processorderform.target='packing'; submitForm(this, 'packing'); document.processorderform.target=''; {rdelim}" />
&nbsp;&nbsp;&nbsp;&nbsp;

make sure this is before the {/if}

If you have already installed this mod and packing slips are working then that is it, you can now batch print packing slips based on selection just like invoices.

Sorry it's taken me so long to even look at this but I'm pleased that I now have it working, it will really save me time, I hope it does the same for you.
__________________
Chris Barber
Version 4.1.9
MOD - BCSE Shipping Estimator
MOD - Shopzilla Feed
MOD - Price Match with Captcha
MOD - Links Manager 2008
MOD - One Page Checkout
MOD - Sitemap
  #37  
Old 04-10-2008, 07:27 AM
 
telimon telimon is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 92
 

Default Re: Printable Packing Slip - 4.0.x

Can I use this in 4.1.8? with the additonal change mentioned
__________________
4.710
  #38  
Old 04-10-2008, 07:29 AM
 
balinor balinor is offline
 

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

Default Re: Printable Packing Slip - 4.0.x

Post #34 covers 4.1.8
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
  #39  
Old 04-10-2008, 07:36 AM
 
telimon telimon is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 92
 

Default Re: Printable Packing Slip - 4.0.x

OK thanks. Is post 34 just mentioning changes to the original code you created, or is it all i need.
__________________
4.710
  #40  
Old 04-11-2008, 02:15 AM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: Printable Packing Slip - 4.0.x

Hey Telimon,

Post 34 contains all the updated code, except for the 2 sample Order Data files in the zip-file at the end of Post 1.

There's really not that many changes between the 4.0.x and 4.1.x branches in this part of the code, so if you go step-by-step, it's real easy to implement.

You don't even need to create the language label as you can hard-code that in (i.e. button_title="Print Packing Slip").

This mod is a lot easier if you have experience modifying the mail/html template files and seeing how the invoice pulls up the order data. If you haven't tried altering mail templates yet, you might want to experiment to see the results and give your store a more personalized and custom look.

Good luck!

Robert
__________________
X-cart 4.1.10
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 07:04 PM.

   

 
X-Cart forums © 2001-2020