Packing Slip

I’d love to see a Packing slip mod / addon, like the one discussed here:

[url]http://vb.cs-cart.com/showthread.php?p=40114[/url], added into CS-Cart 2.

this mod has actually already been done for 1.3.5+, however I’m not sure if it will be included in CS2, I seriously doubt it but I’ll find out, if it is that will be great, if not I will contact the original developer and discuss having this coded by the addon development club…

in controllers>admin>orders.php



just under


} elseif ($mode == 'print_invoice') {
if (!empty($_REQUEST['order_id'])) {
$order_info = fn_get_order_info($_REQUEST['order_id']);
if (empty($order_info)) {
return array(CONTROLLER_STATUS_NO_PAGE);
}

$view_mail->assign('order_info', $order_info);

if (!empty($_REQUEST['format']) && $_REQUEST['format'] == 'pdf') {
fn_html_to_pdf($view_mail->display('orders/print_invoice.tpl', false), fn_get_lang_var('invoice') . '-' . $_REQUEST['order_id']);
} else {
$view_mail->display('orders/print_invoice.tpl');
}

exit;
}




add…




} elseif ($mode == 'print_packingslip') {
if (!empty($_REQUEST['order_id'])) {
$order_info = fn_get_order_info($_REQUEST['order_id']);
if (empty($order_info)) {
return array(CONTROLLER_STATUS_NO_PAGE);
}

$view_mail->assign('order_info', $order_info);

$view_mail->display('orders/print_packingslip.tpl');

exit;
}






in customer/your_skin/mail/orders



create 2 files,

packingslip.tpl and print_packingslip.tpl



in packingslip.tpl add your moded packing slip (this is mine below, but it has been changed slightly from invoice.tpl)


```php



{if $order_info}

{literal}


body,p,div {
color: #000000;
font: 12px Arial;
}
body {
padding: 0;
margin: 0;
}
a, a:link, a:visited, a:hover, a:active {
color: #000000;
text-decoration: underline;
}
a:hover {
text-decoration: none;
}


body {
background-color: #ffffff;
}

{/literal}














{$settings.Company.company_name} {$lang.invoice_title}









{$settings.Company.company_name}


{$settings.Company.company_address}, {$settings.Company.company_city}, {$settings.Company.company_country_descr}, {$settings.Company.company_state_descr}, {$settings.Company.company_zipcode}

{if $settings.Company.company_phone}




{/if}
{if $settings.Company.company_phone_2}




{/if}
{if $settings.Company.company_fax}




{/if}
{if $settings.Company.company_website}




{/if}
{if $settings.Company.company_orders_department}




{/if}
{$lang.phone1_label}: {$settings.Company.company_phone}
{$lang.phone2_label}: {$settings.Company.company_phone_2}
{$lang.fax}: {$settings.Company.company_fax}
{$lang.web_site}: {$settings.Company.company_website}
{$lang.email}: {$settings.Company.company_orders_department}


{$lang.order} #{$order_info.order_id}



{*


*}








{if $order_info.shipping}




{if $tracking_number_exists}




{/if}
{/if}
{$lang.status}: {include file="common_templates/status.tpl" status=$order_info.status display="view"}
{$lang.date}: {$order_info.timestamp|date_format:"`$settings.Appearance.date_format`"}
{$lang.payment_method}: {$order_info.payment_method.payment}
{$lang.shipping_method}:
{foreach from=$order_info.shipping item="shipping" name="f_shipp"}
{$shipping.shipping}
{if !$smarty.foreach.f_shipp.last}, {/if}
{if $shipping.tracking_number}{assign var="tracking_number_exists" value="Y"}{/if}
{/foreach}
{$lang.tracking_number}:
{foreach from=$order_info.shipping item="shipping" name="f_shipp"}
{if $shipping.tracking_number}{$shipping.tracking_number}
{if !$smarty.foreach.f_shipp.last},{/if}
{/if}
{/foreach}



{assign var="profile_fields" value='I'|fn_get_profile_fields}
{split data=$profile_fields.C size=2 assign="contact_fields" simple=true}
{if $profile_fields}


{if $profile_fields.C}

{/if}
{if $profile_fields.B}

{/if}
{if $profile_fields.S}

{/if}


{$lang.customer}:


{$order_info.firstname} {$order_info.lastname}


{$order_info.email}


{$lang.phone}: {$order_info.phone}


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

{$lang.bill_to}:


{if $order_info.b_firstname || $order_info.b_lastname}

{$order_info.b_firstname} {$order_info.b_lastname}

{/if}

{$order_info.b_address}
{if $order_info.b_address_2} {$order_info.b_address_2}{/if}
{if $order_info.b_city && ($order_info.b_address || $order_info.b_address_2)}, {/if}
{$order_info.b_city}
{if $order_info.b_country_descr && ($order_info.b_address || $order_info.b_address_2 || $order_info.b_city)}, {/if}
{$order_info.b_country_descr}



{$order_info.b_state_descr}
{if $order_info.b_state_descr || $order_info.b_zipcode}, {/if}
{$order_info.b_zipcode}


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

{$lang.ship_to}:


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

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

{/if}

{$order_info.s_address}
{if $order_info.s_address_2} {$order_info.s_address_2}{/if}
{if $order_info.s_city && ($order_info.s_address || $order_info.s_address_2)}, {/if}
{$order_info.s_city}
{if $order_info.s_country_descr && ($order_info.s_city || $order_info.s_address)}, {/if}
{$order_info.s_country_descr}



{$order_info.s_state_descr}
{if $order_info.s_zipcode && $order_info.s_state_descr}, {/if}
{$order_info.s_zipcode}


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

{/if}
{* Customer info *}


{* Ordered products *}







{*
{if $order_info.use_discount}

{/if}
{if $order_info.taxes}

{/if}
*}

{foreach from=$order_info.items item="oi"}
{hook name="orders:items_list_row"}
{if !$oi.extra.parent}




{*
{if $order_info.use_discount}

{/if}
{if $order_info.taxes}

{/if}

*}

{/if}
{/hook}
{/foreach}
{hook name="orders:extra_list"}
{/hook}
{$lang.code} {$lang.quantity} {$lang.product} {$lang.unit_price} {$lang.discount} {$lang.tax} {$lang.subtotal}


{hook name="orders:product_info"}
{if $oi.product_code}{$oi.product_code}{/if}
{/hook}
{$oi.amount}
{$oi.product|unescape|default:$lang.deleted_product}

{if $oi.product_options}
{include file="common_templates/options_info.tpl" product_options=$oi.product_options}{/if}
{if $oi.extra.exclude_from_calculate}{$lang.free}{else}{include file="common_templates/price.tpl" value=$oi.price}{/if} {if $oi.extra.discount|floatval}{include file="common_templates/price.tpl" value=$oi.extra.discount}{else} - {/if} {if $oi.tax_value}{include file="common_templates/price.tpl" value=$oi.tax_value}{else} - {/if} {if $oi.extra.exclude_from_calculate}{$lang.free}{else}{include file="common_templates/price.tpl" value=$oi.display_subtotal}{/if}


{hook name="orders:ordered_products"}
{/hook}
{* /Ordered products *}

{* Order totals *}
{*









{if $order_info.discount|floatval}




{/if}

{if $order_info.coupons}
{foreach from=$order_info.coupons item="coupon" key="key"}




{/foreach}
{/if}
{if $order_info.taxes}




{foreach from=$order_info.taxes item=tax_data}




{/foreach}
{/if}
{if $order_info.tax_exempt == 'Y'}




{/if}

{if $order_info.payment_surcharge|floatval}




{/if}


{if $order_info.shipping}




{/if}
{hook name="orders:totals"}
{/hook}








{$lang.subtotal}: {include file="common_templates/price.tpl" value=$order_info.display_subtotal}
{$lang.including_discount}:
{include file="common_templates/price.tpl" value=$order_info.discount}
{$lang.coupon}: {$key}
{$lang.taxes}:
{$tax_data.description} {include file="common_templates/modifier.tpl" mod_value=$tax_data.rate_value mod_type=$tax_data.rate_type}{if $tax_data.price_includes_tax == "Y" && $settings.Appearance.cart_prices_w_taxes != "Y"} {$lang.included}{/if}{if $tax_data.regnumber} ({$tax_data.regnumber}){/if}: {include file="common_templates/price.tpl" value=$tax_data.tax_subtotal}
{$lang.tax_exempt}
{$lang.payment_surcharge}: {include file="common_templates/price.tpl" value=$order_info.payment_surcharge}
{$lang.shipping_cost}: {include file="common_templates/price.tpl" value=$order_info.display_shipping_cost}

{$lang.total_cost}: {include file="common_templates/price.tpl" value=$order_info.total}

*}



{* /Order totals *}

{if $order_info.notes}
{$lang.notes}:

{$order_info.notes|wordwrap:90:"\n":true|nl2br}

{/if}

{if $content == "invoice"}






{include file="buttons/continue_shopping.tpl" but_href=$continue_url|default:$index_script but_arrow="on" skin_area="customer"}

{include file="buttons/button_popup.tpl" but_text=$lang.print_invoice but_href="`$index_script`?dispatch=orders.print_invoice&order_id=`$order_info.order_id`" width="800" height="600" skin_area="customer"}

{/if}
{/if}

{hook name="orders:invoice"}
{/hook}


```

in print_packingslip.tpl add
```php







{include file="orders/invoice.tpl"}



```


Then finally, in
skins/basic/admin/views/orders/details.tpl, just before

```php
{include file="buttons/button_popup.tpl" but_text=$lang.print_invoice but_href="`$index_script`?dispatch=orders.print_invoice&order_id=`$order_info.order_id`" width="900" height="600" but_role="tool"} |
```

Add...

```php
{include file="buttons/button_popup.tpl" action_but="action_" but_text=$lang.print_packingslip but_href="`$index_script`?dispatch=orders.print_packingslip&order_id=`$order_info.order_id`" width="900" height="600" but_role="tool"} |
```

Then make a language for print_packingslip under content> language

I have no idea if this is cleanly coded, but I hacked to my limited knowledge and it worked for me...

Today’s update - CS-Cart 2.0.6 - includes the Packing slip feature.



Feel free to share your comments or suggestions about it.

[quote name=‘admin’]Today’s update - CS-Cart 2.0.6 - includes the Packing slip feature.



Feel free to share your comments or suggestions about it.[/QUOTE]

Oh my god, this is a big news!!!