Making Tracking Numbers Clickable

This is something that kind of annoys me about CS-Cart.



When I enter in a tracking number the customer has to copy/paste the number into the shipping company’s website. This seems kind of dumb and not very efficient. Is there a way to make the tracking number clickable?



On each of my supplier’s carts I am able to just click on the tracking number and then go to the shipping page to get more information about my shipment.



Another thing, along the same lines, is that I can’t figure out a way to add a tracking number for shipments with free shipping. Does anyone have any ideas?



One last thing is that while my shipping settings are set up for UPS only, some of my suppliers ship Fedex. I would think that when I select the “carrier” that the invoice would show the carrier name with the appropriate tracking number. Unfortunately this isn’t the case. Right now all my invoices just show UPS Ground and not the selected carrier.



Now I did kind of fix that last problem. My solution isn’t perfect, but at least it does kind of show the “carrier” name.



What I did was:



In:



skins/basic/mail/orders/invoice.tpl



I changed:



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




To:



{foreach from=$order_info.shipping item="shipping" name="f_shipp"}
{$shipping.carrier}
{if !$smarty.foreach.f_shipp.last}, {/if}
{if $shipping.tracking_number}{assign var="tracking_number_exists" value="Y"}{/if}
{/foreach}




Anyways, if anyone can help me with this stuff I would really appreciate it.



Thank you,



Brandon

brandon-



You might want to add your comment to a similar Bug Tracker request:

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=1642[/url]



This really should be a standard feature of the cart.



Bob

Brandon you have been great help around here and you are absolutely right , this should be standard and I don’t understand why it is not.



I have implemented a work around that I used on my 1.35 install from another member here.So the credit goes to him. I only use UPS and Fedex if you use something else you can add it.



You will need to create 3 files in /skins/ACTIVE-SKIN/mail/orders



First file : ship_track.tpl with this code:

Your order was Shipped Via:

{foreach from=$order_info.shipping item="shipping" key="shipping_id" name="f_shipp"}


{if $shipping.carrier == 'FDX'}
{$lang.fedex}

{include file="orders/track_fedex.tpl"}
{/if}
{if $shipping.carrier == 'UPS'}
{$lang.ups}

{include file="orders/trackups.tpl"}
{/if}


{/foreach}




second file : trackups.tpl with this code


{if $shipping.tracking_number|strlen >0}
Your shipment can be tracked via Tracking #

{$shipping.tracking_number}


{/if}




Third file : track_fedex.tpl with this code:


{if $shipping.tracking_number|strlen >0}
Your shipment can be tracked via Tracking #

{$shipping.tracking_number}


{/if}




Now edit skins/ACTIVE_SKIN/mail/orders/order_notification.tpl


* $Id: order_notification.tpl 7703 2009-07-13 10:36:45Z angel $ *}

{include file="letter_header.tpl"}

{$lang.dear} {$order_info.firstname} {$order_info.lastname},



{$order_status.email_header|unescape}



{if $order_info.status == 'C'}

{include file="orders/ship_track.tpl"}
[COLOR="Red"]{include file="orders/completed.tpl"}[/COLOR]
{else}

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




The code in red I did so the email will also have a plain text with the products ordered instead of an invoice.

to do that create another file in skins/ACTIVE_SKINS/mail/orders/completed.tpl



with this code:




----------------------------------------------------------------------------------------------

ORDER DETAILS



Order Number: {$order_info.order_id}

Date: {$order_info.timestamp|date_format:"`$settings.Appearance.date_format`, `$settings.Appearance.time_format`"}

Status: {include file="orders/order_status.tpl" status=$order_info.status display="view"}


{if $order_info.shipping}
{$lang.shipping_method}: {foreach from=$order_info.shipping item="shipping" name="f_shipp"}{$shipping.shipping}{if !$smarty.foreach.f_shipp.last}, {/if}{/foreach}{/if}

PRODUCTS DETAILS:

{foreach from=$order_info.items item="oi"}
{$oi.amount} x {$oi.product} ({$oi.product_code|default:" "}) {include file="common_templates/price.tpl" value=$oi.subtotal}

{/foreach}


Sub Total: ${$order_info.subtotal}


Shipping: {if $order_info.shipping}{include file="common_templates/price.tpl" value=$order_info.display_shipping_cost}{/if}


-------------------

Total: ${$order_info.total}



----------------------------------------------------------------------------------------------

CONTACT DETAILS



Name: {$order_info.firstname} {$order_info.lastname}

{if $order_info.company}Company: {$order_info.company}
{/if}
Email: {$order_info.email}

{if $order_info.phone}Phone: {$order_info.phone}
{/if}


----------------------------------------------------------------------------------------------

BILLING DETAILS



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

{assign var="profile_fields" value='I'|fn_get_profile_fields}
{foreach from=$profile_fields.B item="field"}
{if !$field.field_name}
{assign var="data_id" value=$field.field_id}
{assign var="value" value=$order_info.fields.$data_id}
{if $value}{$value}
{/if}
{/if}
{/foreach}
{$order_info.b_address}

{if $order_info.b_address_2}{$order_info.b_address_2}
{/if}
{$order_info.b_city}

{$order_info.b_state_descr}

{$order_info.b_zipcode}

{$order_info.b_country_descr}



----------------------------------------------------------------------------------------------

SHIPPING DETAILS



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

{assign var="profile_fields" value='I'|fn_get_profile_fields}
{foreach from=$profile_fields.S item="field"}
{if !$field.field_name}
{assign var="data_id" value=$field.field_id}
{assign var="value" value=$order_info.fields.$data_id}
{if $value}{$value}
{/if}
{/if}
{/foreach}
{$order_info.s_address}

{if $order_info.s_address_2}{$order_info.s_address_2}
{/if}
{$order_info.s_city}

{$order_info.s_state_descr}

{$order_info.s_zipcode}

{$order_info.s_country_descr}





You can customize this file to whatever you like. The order have to be in completed status for this to work otherwise the customer gets the standard notification.



I have tested this on 2.0.12 and it works perfectly.



Hope this helps



Joe

Straight from the horses mouth



Dear Jesse-Lee,



This functionality was not removed from CS-Cart version 2.0. A tracking number is displayed as a link (it is required to select a carrier in the “Carrier” select box on the order details page in CS-Cart admin panel) on the order details page and as a text in the invoice in CS-Cart version 1.3.5. The same is for CS-Cart version 2.0, i.e. a tracking number is displayed as a link on the order details page and as a text in the invoice.



In order to display a tracking code as a link in the invoice please 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}
Save the file. Please check it and let us know the result. Thank you.



Sincerely yours,

Maria Zuzanova

Technical support engineer

CS-Cart Knowledge Base: http://kb2.cs-cart.com

[quote name=‘JesseLeeStringer’]Straight from the horses mouth



Dear Jesse-Lee,



This functionality was not removed from CS-Cart version 2.0. A tracking number is displayed as a link (it is required to select a carrier in the “Carrier” select box on the order details page in CS-Cart admin panel) on the order details page and as a text in the invoice in CS-Cart version 1.3.5. The same is for CS-Cart version 2.0, i.e. a tracking number is displayed as a link on the order details page and as a text in the invoice.



In order to display a tracking code as a link in the invoice please 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}
Save the file. Please check it and let us know the result. Thank you.



Sincerely yours,

Maria Zuzanova

Technical support engineer

CS-Cart Knowledge Base: http://kb2.cs-cart.com[/QUOTE]



Yes it works, but why wasn’t this included from the get go?

Thank you

Thanks for the help guys.



Gasngrills. Your fix looks like it works, but I ended up using Jesse’s. His fix worked perfect and now I have clickable tracking numbers.



It’s kind of funny that CS-Cart says they didn’t take away this functionality even though they had to provide a fix to make it work. Maybe I don’t quite understand missing functions. Oh well. At least now it works.



I also kind of found a fix to adding a tracking number to an order with free shipping. My fix doesn’t work perfect, but it does allow you to create a shipment with a tracking number.



While my fix allows me to create a shipment with a tracking number, I’m not able to create a second shipment or change the first one.



What I did was:



In:



skins/basic/admin/views/profiles/profile_info.tpl



I changed:


{***************** Shipping INFO ******************}
{if $user_data.shipping}




To:


{***************** Shipping INFO ******************}
{*{if $user_data.shipping}*}




And I changed:


code



{/if}

{/if} ```



To:


code



{/if}

{{/if}} ```



Basically I just commented out the if statement.



Thanks again for the help guys,



Brandon

[quote name=‘brandonvd’]Thanks for the help guys.



Gasngrills. Your fix looks like it works, but I ended up using Jesse’s. His fix worked perfect and now I have clickable tracking numbers.



It’s kind of funny that CS-Cart says they didn’t take away this functionality even though they had to provide a fix to make it work. Maybe I don’t quite understand missing functions. Oh well. At least now it works.



I also kind of found a fix to adding a tracking number to an order with free shipping. My fix doesn’t work perfect, but it does allow you to create a shipment with a tracking number.



While my fix allows me to create a shipment with a tracking number, I’m not able to create a second shipment or change the first one.



What I did was:



In:



skins/basic/admin/views/profiles/profile_info.tpl



I changed:


{***************** Shipping INFO ******************}
{if $user_data.shipping}




To:


{***************** Shipping INFO ******************}
{*{if $user_data.shipping}*}




And I changed:


code



{/if}

{/if} ```



To:


code



{/if}

{{/if}} ```



Basically I just commented out the if statement.



Thanks again for the help guys,



Brandon[/QUOTE]



You are very welcome, I tried Jesse’s as well and it works, but I still don’t like the idea for the customer to get an invoice everytime he gets an email.

OK – so the next question is, how do we create a button to track the orders in the back office. Think I’ll try to tackle that one. I like being able to track an order FROM the order without having to cut and paste the tracking number…

[quote name=‘gasngrills’]You are very welcome, I tried Jesse’s as well and it works, but I still don’t like the idea for the customer to get an invoice everytime he gets an email.[/QUOTE]



Joe,



Ok, so your mod makes it so a separate email goes out and doesn’t include the invoice? I guess I didn’t get that. I do agree with you one this.



Now 2.0.12 does have a solution to this though. Instead of just pasting the tracking number into the box, if you create a new shipment with the tracking number that just the shipment information is sent to the customer and not the whole invoice.



It actually works pretty well.



Thanks again,



Brandon

[quote name=‘brandonvd’]

Now 2.0.12 does have a solution to this though. Instead of just pasting the tracking number into the box, if you create a new shipment with the tracking number that just the shipment information is sent to the customer and not the whole invoice.



It actually works pretty well.[/QUOTE]

Brandon-



I agree. I think they should eliminate the old “shipping information” tracking/carrier entry in favor of “shipments”. They could make the current shipping information display-only with the last shipment information. Currently, there are inconsistencies between the way tracking information is displayed for the customer based on which method is used which also need to be addresed.



Does the shipments feature allow you to enter tracking information on orders with free shipping? How is your free shipping defined? I can’t seem to replicate this.



Bob

[quote name=‘brandonvd’]Joe,



Ok, so your mod makes it so a separate email goes out and doesn’t include the invoice? I guess I didn’t get that. I do agree with you one this.



Now 2.0.12 does have a solution to this though. Instead of just pasting the tracking number into the box, if you create a new shipment with the tracking number that just the shipment information is sent to the customer and not the whole invoice.



It actually works pretty well.



Thanks again,



Brandon[/QUOTE]



Yes that is true ,and actualy this is one of the great things that were added to version 2.0 but that only works on the shipment , what happens if you change status on an order few times, the customer gets an invoice every time. You can change this by modifying the order_notification.tpl file by using if and elseif statements to call for different tpl files for each status and put whatever you want in there.

Bob,



When you edit or create a product you can choose if it is free shipping or not. If you choose this option you are not able to add a tracking number for that purchase if that is the only thing purchased. I only have one of these products, but it is also my $1.00 test product that I use to test my checkout procedure.



With my little “mod” I am now able to enter in the tracking number as a shipment. It doesn’t work all that well, but at least the tracking number can be entered and the customer is notified. So I guess that is good enough for now.



Joe,



You can set what order statuses email the customer in the order statuses part of the admin. The only ones that email of mine are Approved, Completed, and Declined. Basically, just the basics.



Like I said before, if you use the shipments thing than the customer doesn’t get an invoice when the tracking information is added.



Brandon

[quote name=‘brandonvd’]When you edit or create a product you can choose if it is free shipping or not. If you choose this option you are not able to add a tracking number for that purchase if that is the only thing purchased. I only have one of these products, but it is also my $1.00 test product that I use to test my checkout procedure.



With my little “mod” I am now able to enter in the tracking number as a shipment. It doesn’t work all that well, but at least the tracking number can be entered and the customer is notified. So I guess that is good enough for now.[/QUOTE]

Brandon-



This really should be entered into the Bug Tracker as a bug. “Free shipping” implies a shipment, not no shipment. They should fix this.



Bob

Bob,



Another bug tracker for me?



Yeah, your right I guess. If I make it soon maybe CS-Cart will see it tonight.



Brandon

[quote name=‘brandonvd’]Bob,



Another bug tracker for me?



Yeah, your right I guess. If I make it soon maybe CS-Cart will see it tonight.



Brandon[/QUOTE]



Brandon did you create a bug for this? I’d like to add my comments to it. Unlike you, we ship a number of products for free via ground shipping since the costs for our ground shipments are usually less than $5 per shipment and it’s a good thing for us to provide for our customers. However not being able to provide a tracking number for a free shipment is just really counter intuitive. It is free, yes, but it is still a shipment. I need to get the tracking number to my customers after I pay the carrier and not being able to do that easily is extremely frustrating.



If this isn’t a fix to 2.0.13, we’ll have to pay for a mod, we can’t continue like this. I’m going to check if the FedEx addon on www.shippingkit.com provides this functionality before I pay someone to do it.



Chris

ChrisW-



Brandon’s bug is posted here:

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=1696[/url]



Bob

Just to let you all know, the clickable tracking number still isn’t fixed in 2.0.14. Jesse’s fix does still seem to fix it though.



Brandon

Greetings.



Re version 2.1.1



I had been using Jessie’s code in version 2.0.14 and the clickable tracking numbers worked flawlessly. However, after I upgraded to 2.1.1 this feature no longer worked.:confused: Subsequently, I contacted support and they told me the architecture was completely changed and that mod would not work and that they could quote me a price to make the necessary modifications so it would work. Well, guess what I discovered! Jessie’s code DOES WORK in version 2.1.1, BUT… in order for it to work you MUST [COLOR=Red]uncheck the box[/COLOR] for “[COLOR=Teal]Allow to create shipment[/COLOR]” under the AdministrationSettings tab in the admin panel. Once I unchecked the box, presto-chango, it works perfectly! Hope this post helps.



Bill G., manager/developer