X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Printable Packing Slip - 4.4.x (https://forum.x-cart.com/showthread.php?t=60671)

balinor 08-25-2011 08:31 AM

Printable Packing Slip - 4.4.x
 
2 Attachment(s)
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%}&nbsp;::&nbsp;{/if}
{$location[position].0|strip_tags|escape}
{/section}
{else}
{section name=position loop=$location step=-1}
{if not %position.first%}&nbsp;::&nbsp;{/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:"&nbsp;":" "|truncate:$config.SEO.page_title_limit|replace:" ":"&nbsp;"}
{/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!

imageizeverything 08-25-2011 11:38 AM

Re: Printable Packing Slip - 4.4.x
 
I followed the instructions Exactly like your stated. But when I click on the "Print Packing Slip" button, I get a Blank page.

Is there something missing?

balinor 08-25-2011 12:11 PM

Re: Printable Packing Slip - 4.4.x
 
Double check that you uploaded the files to the correct place.

imageizeverything 08-25-2011 12:52 PM

Re: Printable Packing Slip - 4.4.x
 
Quote:

Originally Posted by balinor
Double check that you uploaded the files to the correct place.


You are correct. I accidentally uploaded the 2 files: order_data_packing.tpl and order_invoice_packing.tpl in the wrong folders.
I accidentally placed them in: skin/common_files/mail/
I deleted them, then uploaded in: skin/common_files/mail/html

It's now working, Thanks a Million!

* Now I need to modify the Packing Slip to add
1) My Logo
2) Each Product's SKU # (like on the Invoice) Very Important.
3) I wish there was 2 more columns for each product (to the right of QTY column). One titled "Shipped" (Yes or No), and another titled "Backordered" (displaying the 1 of items backordered for that product, if any, Zero being the default).
4) And a row underneath the table titled "Total Items Shipped", indicating the Total Number of items shipped.

imageizeverything 08-25-2011 01:17 PM

Re: Printable Packing Slip - 4.4.x
 
I noticed in the order_invoice_packing.tpl file, at the end, there is a tag: {$lng.txt_thank_you_for_purchase_packing}
It doesn't display anything on the Packing Slip.

What do I need to do to fix that?

balinor 08-25-2011 01:33 PM

Re: Printable Packing Slip - 4.4.x
 
You can do whatever you want with the packing slip/invoice, that is up to you. The variable at the bottom is a custom one so that the packing slip has a different footer message than the invoice. I've added that to the install instructions.

imageizeverything 08-25-2011 01:46 PM

Re: Printable Packing Slip - 4.4.x
 
Quote:

Originally Posted by balinor
You can do whatever you want with the packing slip/invoice, that is up to you. The variable at the bottom is a custom one so that the packing slip has a different footer message than the invoice. I've added that to the install instructions.


Thanks. I created the variable in the languages section and it's working fine.

On Line 52 in order_invoice_packing.tpl file there is the code: <img src="{$ImagesDir}/invoice-logo.png" /> It's not showing my logo on the Packing Slip.

Do I need to create an additional logo file and upload it?

Thanks in advance for your assistance.

balinor 08-25-2011 02:27 PM

Re: Printable Packing Slip - 4.4.x
 
You can change that image to whatever you want.

imageizeverything 08-25-2011 02:38 PM

Re: Printable Packing Slip - 4.4.x
 
Quote:

Originally Posted by balinor
You can change that image to whatever you want.


What folder should it be uploaded too? I added it to folder: /skin/vivid_dreams_chromo/images/vivid_dreams/

And it's not showing up.

JacksmithxD 08-25-2011 11:32 PM

Re: Printable Packing Slip - 4.4.x
 
Quote:

Originally Posted by imageizeverything

And it's not showing up.



You could try changing the code to be more specific, I think that something like this would work. /skin/vivid_dreams_chromo/images/vivid_dreams/logo.png

You will also have to rename the last part of the code to match your invoice logo as people tend to rename these.

e.g <img src="{$ImagesDir}/invoice-logo.png" />

will be <img src="{$ImagesDir}/YOURLOGOFILESNAME.png" />

Don't take my word for it though, i'm a complete noob.

balinor 08-26-2011 04:10 AM

Re: Printable Packing Slip - 4.4.x
 
The default images directory (specified by {$ImagesDir} is skin/common_files/images

imageizeverything 08-26-2011 04:22 AM

Re: Printable Packing Slip - 4.4.x
 
Quote:

Originally Posted by balinor
The default images directory (specified by {$ImagesDir} is skin/common_files/images


Yeah.. I figured that out right after posting my question. Thanks for the follow-up. I appreciate it.

thebluedoorboutique 09-05-2011 03:21 PM

Re: Printable Packing Slip - 4.4.x
 
Does any one know how to do the batch function with v4.4.X? Let me know.

balinor 09-06-2011 05:12 AM

Re: Printable Packing Slip - 4.4.x
 
This doesn't work for the batch function, sorry :(

masada3336 01-13-2012 03:33 PM

Re: Printable Packing Slip - 4.4.x
 
Is there a way to have the pick/pack list display products alphabetically based on the category the product is in, then alpha by the products (within the category)?
If that's possible, It would save me a TON of time, and I'd be happy to pay for the coding.
Thanks!

netZtrack 03-28-2012 05:31 AM

Re: Printable Packing Slip - 4.4.x
 
Hi,

This is a great mod, I was looking for this since many days. Can you please tell me how can I add the product SKU number in the packing slip?

That will help me cross verify the product while shipping, that is the only thing missing I guess.

balinor 03-28-2012 05:59 AM

Re: Printable Packing Slip - 4.4.x
 
{$product.productcode}

stevep 04-01-2012 03:34 AM

Re: Printable Packing Slip - 4.4.x
 
Hello Balinor
Try to download the order data tpl keeps asking me to sign in help please?

Stephen

balinor 04-02-2012 05:03 AM

Re: Printable Packing Slip - 4.4.x
 
???

stevep 04-02-2012 05:17 AM

Re: Printable Packing Slip - 4.4.x
 
Quote:

Originally Posted by balinor
???


when i click the file to download takes me to the sign in screen? why

balinor 04-02-2012 05:20 AM

Re: Printable Packing Slip - 4.4.x
 
I have no idea, you'll have to ask Qualiteam about that.

weckie 09-17-2012 10:46 AM

Re: Printable Packing Slip - 4.4.x
 
{* SORRY, did a good search on the forum, already got it done. *} :)


Hi Nice mod. just implemented it with no problems. just 5 minutes.

one Q tho. I need to have an extra field value on the packing slip, put everything needed for that in the TPL files, nothing shows up.

I think it has to do that these values are not produced in the PHP files???

Do you know how to get these extra field values on the packing slip.

Thanks.



{* SORRY, did a good search on the forum, already got it done. *} :)

verysmallanimal 12-18-2013 04:56 AM

Re: Printable Packing Slip - 4.4.x
 
Hi

I have just tried implementing this in version 4.5.2

I have double checked the amendments and uploaded the files. I can see the Print Packing Slip button in the order, but when I click it I am getting a blank page.

I have triple checked and the 2x tpl files are uploaded to the skin/common_files/mail/html folder.

Can anyone help please?

Regards

Louise

ewebartist 12-01-2014 09:52 AM

Re: Printable Packing Slip - 4.4.x
 
Hi Louise,

Just checking in to see if you ever got it working on 4.5.2, and if so, how did you go about it?

Thanks!

telimon 05-05-2016 08:50 AM

Re: Printable Packing Slip - 4.4.x
 
Hi Guys,
Should edit for adding a packing slip be fine for 4.7.5 as well? I used the former version in 4.1.8

fiberglass.supply 09-01-2016 11:49 AM

Re: Printable Packing Slip - 4.4.x
 
We have 4.6 and the button to print a packing slip is non existent in the admin area.

qualiteam 09-02-2016 03:48 AM

Re: Printable Packing Slip - 4.4.x
 
Quote:

Originally Posted by fiberglass.supply
We have 4.6 and the button to print a packing slip is non existent in the admin area.


Please read the first message in this thread. It was about a custom mod for older XC4 versions. I'm not sure if it still works for the recent XC4.

cherie 09-02-2016 06:39 PM

Re: Printable Packing Slip - 4.4.x
 
Pretty sure this still works, maybe with some small tweaks.

2coolbaby 12-13-2016 01:20 PM

Re: Printable Packing Slip - 4.4.x
 
This is added into 4.7.5, no need to custom install this. Works great, but the sender address is malformed. Any ideas what file to fix that in? Sender address is like this:

No company name - street address, City
State, Zip

Should be:

Company Name
street address
City, State Zip

Just not sure where to fix it.


All times are GMT -8. The time now is 10:18 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.