Julian Lannigan

Clickable Tracking Number { 0 }

This post was originally from an interspire forum that I initially posted this fix on to. View HERE.

Problem

This problem relates to the Interspire Shopping Cart 4.0 and greater.  The problem is that when a user submits an order and a tracking number is entered in for the order, the user is not able to click on a link from the order status page that takes them directly to the given shipping carrier’s package tracking application.  This solution will give step-by-step instructions on how to make this change.

Solution

GetTrackingLink

Returns: String containing the tracking link for this item.

If a shipping module supports tracking shipped packages online, GetTracking link should return the URL to the tracking service to be shown on the “Order Status” page on the front end of the store.

Quote from http://idn.interspire.com/articles/35/1/Interspire-Shopping-Cart-Shipping-Module-Documentation/Page1.html#doc_callbacks

When dealing with these shipping modules I would stray away from editing the template files for changing those files is a kind of global change, in regards to the shipping methods.  This is usually not desired for most people that are using multiple shipping carriers/methods.  Each shipping module contains a call-back called “GetTrackingLink”. This call back is just suppose to return a full URL.  The URL will most likely be the link that a user can click on and take them to the tracking website. For this explanation I will use the Fedex shipping module to show this hack.

  1. Always backup before changing any files.
  2. Open the shipping module class file, in this case SHOP_PATH + /modules/shipping/fedex/module.fedex.php
  3. Navigate to the GetTrackingLink call-back function, in the fedex module its around line 504. Create it if it doesn’t exist.
  4. Change line 506 to:
    return "http://www.fedex.com/Tracking?action=track&tracknumbers=" . $GLOBALS["OrderTrackingNo"];

  5. Save and upload the newly edited shipping module.

Please note that you can adapt this method to any shipping method.  Just know that $GLOBALS[“OrderTrackingNo”] contains the tracking number for the current order.

~JL

Be Sociable, Share!

Leave a Reply