Should Tracking Numbers be included with emails

Should I be seeing a live tracking number link when an email is sent. I’m not seeing this on any of the emails sent when the status is changed. If so, can you suggest what I should be looking at to resolve this? A carrier and valid link was entered into the shipping info.

Should be in the shipping portion of an invoice if the product in question has shipment information.

[quote name='tbirnseth' timestamp='1312875136' post='119175']

Should be in the shipping portion of an invoice if the product in question has shipment information.

[/quote]



Can you clarify what you mean by “has shipment information”. The shipping properties product I am testing with has a weight of .50 lbs, no shipping freight or items in box is specified. I've filled in UPS Ground and a UPS tracking number for the order's shipment information. I suspect there is something I have missed.



Thanks.

Each order has a section called “Shipment info” (or something close). You update what carrier, and what tracking numbers in this area and that's what's displayed in the customer's invoice. If you are using a 3rd party shipping product then you will need to be sure they integrate with cs-cart for updating that info when a label is printed.

This was just a misunderstanding. I was under the impress the tracking number would be a live link to UPS.

I believe they try to detect the carrier by the number and then it becomes a link.

Admin>Settings>General (Allow users to create Shipments) CHECKED



Then, view an order from admin panel and Create a “Shipment”



You will enter the shipment particulars including Tracking Number as well as the “Carrier Name”



The carrier name you enter should then be displayed as a Live Link on your customers email notification…



(Create a “test Customer Account” using one of your own email addresses and test the exact behaviour)



Biggest downfall I see with the “Shipments” functionality is that it automatically “assumes” that the actual ship date is the date you create the shipment in cs-cart, quite often this is not the case as the shipment could have easily been made the day before! And that really pisses me off that you cannot change the actual “Shipment Date” which should definately be a variable! (It’s like where is the business logic?) :angry:

I do not use the method that Struck has provided (it seems like too much trouble) and I do not know if this works for 2.2.x but the following is what I have done for 2.1.4.



Edit: This post has been edited to reflect changes for version 2.2.2



Copy the “carriers.tpl” file located in the “skins/[CUSTOMER_ACTIVE_SKIN]/customer/common_templates” directory to the “skins/[CUSTOMER_ACTIVE_SKIN]/mail/common_templates” directory and then replace the following part of code in the “invoice.tpl” file located in the “skins/[CUSTOMER_ACTIVE_SKIN]/mail/orders” directory:


{if $tracking_number_exists}

{$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}

{/if}
{/if}


with this one:

{if $tracking_number_exists}

{$lang.tracking_number}:

{foreach from=$order_info.shipping item="shipping" name="f_shipp"}
{if $shipping.tracking_number}
{*$shipping.tracking_number*}
{if $shipping.carrier && $shipping.tracking_number}
{include file="common_templates/carriers.tpl" carrier=$shipping.carrier tracking_number=$shipping.tracking_number}
{$shipping.tracking_number}
{/if}
{if !$smarty.foreach.f_shipp.last},{/if}
{/if}
{/foreach}

{/if}

[quote name='The Tool' timestamp='1313102568' post='119376']

I do not use the method that Struck has provided (it seems like too much trouble) and I do not know if this works for 2.2.x but the following is what I have done for 2.1.4.



Copy the “carriers.tpl” file located in the “skins/[CUSTOMER_ACTIVE_SKIN]/customer/common_templates” directory to the “skins/[CUSTOMER_ACTIVE_SKIN]/mail/common_templates” directory and then replace the following part of code in the “invoice.tpl” file located in the “skins/[CUSTOMER_ACTIVE_SKIN]/mail/orders” directory:


{if $tracking_number_exists}

{$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}


{/if}


with this one:


{if $tracking_number_exists}

{$lang.tracking_number}:

{foreach from=$order_info.shipping item="shipping" name="f_shipp"}
{if $shipping.tracking_number}
{*$shipping.tracking_number*}
{if $shipping.carrier && $shipping.tracking_number}
{include file="common_templates/carriers.tpl" carrier=$shipping.carrier tracking_number=$shipping.tracking_number}
{$shipping.tracking_number}
{/if}
{if !$smarty.foreach.f_shipp.last},{/if}
{/if}
{/foreach}


{/if}


[/quote]





Thanks for this. Just so I am clear, by implementing this mod, the tracking number on the email should be a live link to the carrier's site? I'm getting the tracking number but not the link.

[quote name='novista' timestamp='1313426761' post='119543']

Thanks for this. Just so I am clear, by implementing this mod, the tracking number on the email should be a live link to the carrier's site? I'm getting the tracking number but not the link.

[/quote]



Correct

Well I use the shipments thing and I noticed that when a customer receives an email about the shipment, the tracking number isn't clickable. So, I went ahead and did a little mod to make the number clickable. It would be cool if this was an addon, but here it is anyway.



1.) Create a file called skins/your-skin/mail/common_templates/shipment_carriers.tpl



In that file, put:


{* $Id: carriers.tpl 12089 2011-03-22 14:34:09Z alexions $ *}

{if $carrier == "USP"}
{assign var="url" value="http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?strOrigTrackNum=`$shipment.tracking_number`"}
{assign var="carrier_name" value=$lang.usps}
{elseif $carrier == "UPS"}
{assign var="url" value="http://wwwapps.ups.com/WebTracking/processInputRequest?AgreeToTermsAndConditions=yes&tracknum=`$shipment.tracking_number`"}
{assign var="carrier_name" value=$lang.ups}
{elseif $carrier == "FDX"}
{assign var="url" value="http://fedex.com/Tracking?action=track&tracknumbers=`$shipment.tracking_number`"}
{assign var="carrier_name" value=$lang.fedex}
{elseif $carrier == "AUP"}




{assign var="url" value="javascript: document.tracking_form`$shipment_id`.submit();"}
{assign var="carrier_name" value=$lang.australia_post}
{elseif $carrier == "DHL" || $shipping.carrier == "ARB"}



{assign var="url" value="javascript: document.tracking_form`$shipment_id`.submit();"}
{assign var="carrier_name" value=$lang.dhl}
{elseif $carrier == "CHP"}
{assign var="url" value="http://www.post.ch/swisspost-tracking?formattedParcelCodes=`$shipment.tracking_number`"}
{assign var="carrier_name" value=$lang.chp}
{/if}

{capture name="carrier_name"}
{$carrier_name}
{/capture}

{capture name="carrier_url"}
{$url}
{/capture}




2.) In skins/your-skin/mail/shipments/shipment_products.tpl



Change:


{if $shipment.tracking_number}
{$lang.tracking_number}: {$shipment.tracking_number}


{/if}




To:


{if $shipment.tracking_number}
{include file="common_templates/shipment_carriers.tpl" carrier=$shipment.carrier}
{foreach from=$order_info.shipping item="shipping" name="f_shipp"}
{$lang.tracking_number}{$shipment.tracking_number}{if !$smarty.foreach.f_shipp.last},{/if}{/foreach}



{/if}




Now your shipment notification emails will contain clickable tracking numbers to the carrier's website.



Hope you like it.



Thanks,



Brandon

Thanks to everyone who helped out with sample code on this. Looks like v2.2x handles this differently which is why I could not get it working.



First, skin/mail/common_templates/carriers.tpl is included with release 2.2x so there is no reason to create it as the other examples mentioned.



To make your tracking number a live link in the shipment notification email for v2.2.1, edit skins/YOUR_SKIN/mail/shipments/shipment_products.tpl.



Replace this:


{if $shipment.tracking_number}
{$lang.tracking_number}: {$shipment.tracking_number}


{/if}




with this:



{if $shipment.tracking_number}
{include file="common_templates/carriers.tpl" carrier=$shipment.carrier tracking_number=$shipment.tracking_number}
{$lang.tracking_number}{$shipment.tracking_number}


{/if}




That's all I needed to do. I suspect this will be feature in a future release.

[quote name='novista' timestamp='1313693162' post='119803']I suspect this will be feature in a future release.

[/quote]



Don't hold your breath.

[quote]Don’t hold your breath.[/quote]



I wonder if he is a betting man?? :)

Suddenly, I don't like the odds.

Well CS-Cart has basically said that nothing will be done if it isn't in the ideas so I created a new idea. You can see it at http://cscart.uservoice.com/forums/40782-professional/suggestions/2173411-please-make-tracking-numbers-in-the-shipments-clic



Also, novista, I like what you did with the code. I see how you added the tracking number to it instead of having to create a whole new page.



Have you tested it with a real tracking number?



Thanks,



Brandon

I've tested with UPS and USPS. The urls are static so as long as you have a correct tracking number, it should work.

I can't give my full code as it's intellectual property of the company I manage.



However, I can give you a snippet that should work. Be warned that this suits 2.0.15 and is untested otherwise, but it should work.



Where you see '{if $shipment.carrier && $shipment.tracking_number}', underneath manipulate the code.



{if $shipment.carrier == "UPS"}
{assign var="url" value="http://wwwapps.ups.com/WebTracking/processInputRequest?AgreeToTermsAndConditions=yes&tracknum=`$shipment.tracking_number`";;}
{elseif $shipment.carrier == "FDX"}
{assign var="url" value="http://fedex.com/Tracking?action=track&tracknumbers=`$shipment.tracking_number`";;}
{/if}
{$shipment.shipment}{$shipment.tracking_number}
{else}
{$shipment.shipment}
{/if}

Jesse,



I haven't tested novista's solution since I already have my solution in place and am too lazy to change it, but I know my solution works great. It also doesn't matter what shipper you use since it will work with all of them.



If novista's solution works, and I'm sure yours does as well, that would make three different solutions for one problem. At least this will give CS-Cart some options if they actually do this at some point.



Thanks,



Brandon

I used novista's method and it works well, except I'm getting a strange repeated character in front of the tracking number. Here's what I get:



Order ID: #17

Shipping Method: Standard Shipping

Shipment date: 01/16/2012, 09:40

Carrier: U.S. Postal Service

Ê Ê Ê Ê Ê Ê Ê Ê Ê Ê Ê Ê Ê Ê Ê Ê Tracking number: 123456



Any ideas as to where this is coming from?



Andrew






[quote name='novista' timestamp='1313693162' post='119803'] Thanks to everyone who helped out with sample code on this. Looks like v2.2x handles this differently which is why I could not get it working. First, skin/mail/common_templates/carriers.tpl is included with release 2.2x so there is no reason to create it as the other examples mentioned. To make your tracking number a live link in the shipment notification email for v2.2.1, edit skins/YOUR_SKIN/mail/shipments/shipment_products.tpl. Replace this: {if $shipment.tracking_number} [b]{$lang.tracking_number}[/b]: {$shipment.tracking_number}

{/if}
with this: {if $shipment.tracking_number} {include file="common_templates/carriers.tpl" carrier=$shipment.carrier tracking_number=$shipment.tracking_number} [b]{$lang.tracking_number}[/b]: [url="{$smarty.capture.carrier_url}"]{$shipment.tracking_number}[/url]

{/if}
That's all I needed to do. I suspect this will be feature in a future release. [/quote]