Big 'N' Bold Packing Slip

A simple mod to allow larger display of the recipient address on standard packing slips.[list]

[]Auto Capitalization of the customer’s name and address.

[
]Auto Uppercase for the City/Suburb

[]Uses the Code prefix rather than description (Victoria = VIC, Florida = FL)

[
]Easier to read size for printouts on letter or A4 paper.

[*]Hides the Country is ‘Australia’ - Change to your own country to save the extra print line.

[/list]



skins/basic/mail/orders/print_packing_slip.tpl

Line 45 Start

Line End @


<br />
   	 {if $profile_fields.S}<br />
        <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-top: 32px;"><br />
        <tr valign="top"><br />
            <td width="100%" align="center" style="border-bottom: 1px dashed #000000; padding-bottom: 20px;"><br />
            <!--    <h3 style="font: bold 17px Tahoma; padding: 0px 0px 3px 1px; margin: 0px;">{$lang.ship_to}:</h3> --><br />
                {if $order_info.s_firstname || $order_info.s_lastname}<br />
                <p style="margin: 2px 0px 3px 0px; font-size: 32px; text-transform: capitalize;"><br />
                    {$order_info.s_firstname} {$order_info.s_lastname}<br />
                </p><br />
                {/if}<br />
                {if $order_info.s_address || $order_info.s_address_2}<br />
                <p style="margin: 2px 0px 3px 0px; font-size: 32px; text-transform: capitalize;"><br />
                    {$order_info.s_address}, {$order_info.s_address_2}<br />
                </p><br />
                {/if}<br />
                {if $order_info.s_city || $order_info.s_state_descr || $order_info.s_zipcode}<br />
                <p style="margin: 2px 0px 3px 0px; font-size: 32px; text-transform: uppercase;"><br />
                    {$order_info.s_city}, <br />{$order_info.s_state}, {$order_info.s_zipcode}<br />
                </p><br />
                {/if}<br />
                {if $order_info.s_country_descr !="Australia"}<br />
                <p style="margin: 2px 0px 3px 0px; font-size: 32px; text-transform: capitalize;"><br />
                    {$order_info.s_country_descr}<br />
                </p><br />
                {/if}<br />
                {include file="profiles/profiles_extra_fields.tpl" fields=$profile_fields.S}<br />
            </td><br />
        </tr><br />

Wow this is great! Love that it will clean up the address.

Will this work with CS-Cart 2.2?



Just tried it and it works great in my cs-cart 2.2 !!

Thank you @JesseLeeStringer!

Hey @JesseLeeStringer, do you know how to 'hide' extra profile fields if they are not used?

I have a profile field called 'Company Name:' which will print out on the invoice/packing slip even if that field is blank. (most of my customers are regular buyers and not for a business).



I see that it looks for all the extra profiles here:


{include file="profiles/profiles_extra_fields.tpl" fields=$profile_fields.S}




which then looks the profiles_extra_fields.tpl:

```php

{foreach from=$fields item=“field”}

{if !$field.field_name}

{assign var=“value” value=$order_info.fields[$field.field_id]}


{$field.description}:
{if "AOL"|strpos:$field.field_type !== false} {* Titles/States/Countries *}
{assign var="title" value="`$field.field_id`_descr"}
{$user_data.$title}
{elseif $field.field_type == "C"} {* Checkbox *}
{if $value == "Y"}{$lang.yes}{else}{$lang.no}{/if}
{elseif $field.field_type == "D"} {* Date *}
{$value|date_format:$settings.Appearance.date_format}
{elseif "RS"|strpos:$field.field_type !== false} {* Selectbox/Radio *}
{$field.values.$value}
{else} {* input/textarea *}
{$value|default:"-"}
{/if}


{/if}
{/foreach}
```

Is it possible somehow (i think it would go into this tpl?) that if the extra field (in my case it would be the Company Name) if it is blank then it would not print it on the packing slip?

sorry to ask but I hope this is just an easy answer.
thanks!!

Probably should be something like this:


{if $profile_fields.S}
{include file="profiles/profiles_extra_fields.tpl" fields=$profile_fields.S}
{/if}

Nice work. The auto capitalisation feature is a good idea, makes things more legible for a busy courier. Its amazing how many customers either write everything in pixie writing (no caps) OR EVERYTHING IN CAPS. Lol.

[quote name=‘Scott_C’ timestamp=‘1369352646’ post=‘162313’]

Nice work. The auto capitalisation feature is a good idea, makes things more legible for a busy courier. Its amazing how many customers either write everything in pixie writing (no caps) OR EVERYTHING IN CAPS. Lol.

[/quote]



I hear that. Probably should implement it in the fields at checkout/registration to nip it in the bud in the beginning. :D

@Kung Pow Kitty,

I was able to edit profile_extra_fields.tpl to omit the Company when not present like this:

```php {foreach from=$fields item=“field”}

{if !$field.field_name}

{assign var=“value” value=$order_info.fields[$field.field_id]}

{if $field.description == “Company”}

{* input/textarea *}{$value|default:“”}



{else}


{$field.description}:
{if "AOL"|strpos:$field.field_type !== false} {* Titles/States/Countries *}
{assign var="title" value="`$field.field_id`_descr"}
{$user_data.$title}
{elseif $field.field_type == "C"} {* Checkbox *}
{if $value == "Y"}{$lang.yes}{else}{$lang.no}{/if}
{elseif $field.field_type == "D"} {* Date *}
{$value|date_format:$settings.Appearance.date_format}
{elseif "RS"|strpos:$field.field_type !== false} {* Selectbox/Radio *}
{$field.values.$value}
{else} {* input/textarea *}
{$value|default:"-"}
{/if}


{/if}
{/if}
{/foreach} ```

The problem with using this template for "formatting" the Packing Slip's address label is that the formatting applies to ALL pages where the profile extra fields are used, including Invoice, etc.

I don't understand why CS-Cart includes a Company Name in the customer's profile information, but not in the Shipping or Billing information. This would be a lot easier if something as fundamentally required as a "company name" was in with the order info.

I've stopped creating Mailing Labels for customers who purchase USPS First Class Mail as I'm now able to actually USE the top of the packing list as the mailing label. This saved time, money, paper and prevents typos.

I took JesseLeeSinger's fabulous work and formatted the top of the Packing Slip template (/skins/basic/mail/orders/print_packing_slip.tpl). I moved the table border so it's not around the Mailing Label and dotted line. You will have to tweak the first cell width in the table so your city,state,zip all print on one line. Also, “United States” is hard-coded into the template as my country - you can change this to any other country so it doesn't print on the mailing label when you are mailing intra-country.

starting at line 36 - replaces all code thru the Customer info comment in the original template.

```php

{if !$company_placement_info}

{assign var=“company_placement_info” value=$order_info.company_id|fn_get_company_placement_info}

{/if}

{assign var=“profile_fields” value='I'|fn_get_profile_fields}

{if $profile_fields.S}













{$company_placement_info.company_name}

{$company_placement_info.company_address}

{$company_placement_info.company_city}{if $company_placement_info.company_city && ($company_placement_info.company_state_descr || $company_placement_info.company_zipcode)},{/if} {$company_placement_info.company_state_descr} {$company_placement_info.company_zipcode}

{$company_placement_info.company_country_descr}


{$manifest.Mail_logo.alt}

{if $order_info.s_firstname || $order_info.s_lastname}


{$order_info.s_firstname} {$order_info.s_lastname}


{/if}
{include file="profiles/profiles_extra_fields.tpl" fields=$profile_fields.S}
{if $order_info.s_address || $order_info.s_address_2}


{$order_info.s_address}
{$order_info.s_address_2}


{/if}
{if $order_info.s_city || $order_info.s_state_descr || $order_info.s_zipcode}


{$order_info.s_city} {$order_info.s_state} {$order_info.s_zipcode}


{/if}
{if $order_info.s_country_descr !="United States"}


{$order_info.s_country_descr}


{/if}




{/if}




{* Customer info *}
```

Also, a paper cutter is required :-)

I have referenced http://www.bitboost…ss-formats.html for years to assist me in formatting International Address formats for shipping.

In an effort to apply the rules for proper placement of Postal Codes on mailing labels I have modified the Packing List template so the top of the printed packing list can be cut off an actually used as the mailing label for First Class & First Class International shipments. (In the US, you can ship up to 4 lbs or $400 value via First Class International, and up to 13oz via First Class domestic).

I have additionally added the Order Number to the label for easy matching to the package, since I pack and ship in separate steps.



Starting at line 36 (CS-Cart v3.0.6) - replaces all code thru the Customer info comment in the original template.

```php

{if !$company_placement_info}

{assign var=“company_placement_info” value=$order_info.company_id|fn_get_company_placement_info}

{/if}

{assign var=“profile_fields” value='I'|fn_get_profile_fields}

{if $profile_fields.S}










{$company_placement_info.company_name}

{$company_placement_info.company_address}

{$company_placement_info.company_city}{if $company_placement_info.company_city && ($company_placement_info.company_state_descr || $company_placement_info.company_zipcode)},{/if} {$company_placement_info.company_state_descr} {$company_placement_info.company_zipcode}

{$company_placement_info.company_country_descr}


{$manifest.Mail_logo.alt}






{$order_info.order_id}
{if $order_info.s_firstname || $order_info.s_lastname}


{$order_info.s_firstname} {$order_info.s_lastname}


{/if}
{include file="profiles/profiles_extra_fields.tpl" fields=$profile_fields.S}
{if $order_info.s_address || $order_info.s_address_2}


{$order_info.s_address}
{$order_info.s_address_2}


{/if}
{if $order_info.s_city || $order_info.s_state_descr || $order_info.s_zipcode}


{if $order_info.s_country_descr == "United States" || $order_info.s_country_descr == "Canada" || $order_info.s_country_descr == "Australia" || $order_info.s_country_descr == "United States Virgin Islands" || $order_info.s_country_descr == "Puerto Rico" || $order_info.s_country_descr == "India" || $order_info.s_country_descr == "Indonesia" || $order_info.s_country_descr == "New Zealand" || $order_info.s_country_descr == "Republic of Singapore" || $order_info.s_country_descr == "South Korea" || $order_info.s_country_descr == "Taiwan"}
{$order_info.s_city} {$order_info.s_state} {$order_info.s_zipcode}
{elseif $order_info.s_country_descr == "United Kingdom (Great Britain)" || $order_info.s_country_descr == "Isle of Man" || $order_info.s_country_descr == "South Africa" || $order_info.s_country_descr == "Russia" || $order_info.s_country_descr == "Ukraine"}
{$order_info.s_city} {$order_info.s_state}
{$order_info.s_zipcode}

{else}
{$order_info.s_zipcode} {$order_info.s_city} {$order_info.s_state}
{/if}


{/if}
{if $order_info.s_country_descr !="United States"}


{$order_info.s_country_descr}


{/if}


{/if}




{* Customer info *}
```

If you ship small packages (under 4 lbs and under $400 in value) worldwide, this is a great time saver.
I should note that I include a small (150 x 34) image of my Logo for Invoices in the label, you will have to adjust these dimensions to accommodate your own logo.

I hope you find this helpful. I have.

Note: In Admin, Shipping&Taxes > Countries, I renamed country name "Singapore" to "Republic of Singapore" - this is the new official name and is used in the logic above.

Does anyone know where this is located in CS-Cart v 4.x?



NVM, found it in the backend files!

To locate the print packing slip file go to the design folder > backend > mail > orders >



You'll find those files there to edit



Happy coding!

If you want to add the customer's email address on the packing slip (so your peons don't need to search for it);





{$lang.email}:
{$order_info.email}