I was looking for a way to add tracking links to the invoice. It is simple enought to just place links in the email invoice, but the links can break because they can get very long like UPS. What I did was to create a simple php module to received a shorten tracking number link from the “completed” invoice. The module determines which shipper tracking number belongs to and automatically links the tracking information for you. If an invalid tracking number is sent, an error message is displayed with a link to your homepage. Here’s how to install this Mod:
Edit your template called mail/orders/invoice.tpl and find this:
[html]
{if $order_info.shipping}
{$lang.shipping_method}: {$order_info.shipping}
{/if}
[/html]
Add these lines of code just below it so it now looks like this:
Now we need to make a new file called tracking.php and place it where your shopping cart is located. Example: If you cart is located at [url]http://www.shopingcart.com/cart/[/url] then you want tracking in the cart folder. Here is the code:
case 11 : header("Location: http://track.dhl-usa.com/TrackByNbr.asp?ShipmentNumber=$tracking"); /* Redirect to DHL */
exit;
break;
case 12 :
case 15 : header("Location: http://www.fedex.com/Tracking?action=track&tracknumbers=$tracking"); /* Redirect to FEDEX */
exit;
break;
case 18 : header("Location: http://wwwapps.ups.com/WebTracking/processRequest?HTMLVersion=5.0&Requester=NES&AgreeToTermsAndConditions=yes&loc=en_US&tracknum=$tracking"); /* Redirect to UPS */
exit;
break;
case 13 :
case 20 :
case 22 : header("Location:http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum=$tracking"); /* Redirect to USPS */
exit;
break;
I implemented this about 2 months ago and it worked great! Now it simply doesn’t work at all…did something change? Do I need to update something? Please let me know if anyone has this working currently. Thanks in advance!!
case 11 : header("Location: http://track.dhl-usa.com/TrackByNbr.asp?ShipmentNumber=$tracking"); /* Redirect to DHL */
exit;
break;
case 12 :
case 15 : header("Location: http://www.fedex.com/Tracking?action=track&tracknumbers=$tracking"); /* Redirect to FEDEX */
exit;
break;
case 18 : header("Location: http://wwwapps.ups.com/WebTracking/processRequest?HTMLVersion=5.0&Requester=NES&AgreeToTermsAndConditions=yes&loc=en_US&tracknum=$tracking"); /* Redirect to UPS */
exit;
break;
case 13 :
case 20 :
case 22 : header("Location:http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum=$tracking"); /* Redirect to USPS */
exit;
break;
I’m still a little confused on where to put the tracking.php file. Does it go in my files on my server or in the template editior admin part of CS-cart?
It is probably a stupid question but I am still fairly new at this.