Handy Parcel Tracking Mod

Category: X-Cart Snippets
Added:
Enter Price $
SKU SKU82111
Quantity

A quick and easy way to add a parcel tracking box to your store.

Support for Royal Mail, Parcel Force, Citylink, Interlink Express, USPS, UPS, Canada Post, Fedex and TNT.

Copy the code below to a new file, track.tpl

v4.1.x users replace customer/menu_dialog.tpl with menu.tpl

Then upload to skin1/customer

{literal} 
<script type="text/javascript"> 
var lastDiv = ""; 
function showDiv(divName) { 
if (lastDiv) { 
document.getElementById(lastDiv).className = "hiddenDiv"; 
} 
if (divName && document.getElementById(divName)) { 
document.getElementById(divName).className = "visibleDiv"; 
lastDiv = divName; 
} 
} 
</script> 
<style type="text/css"> 
.hiddenDiv { display: none; } 
.visibleDiv { display: block; } 
</style> 
{/literal} 
{capture name=menu} 
{* Select Carrier *} 
<form action="#" method="get" name="carrier" id="carrier">
  <select name="selectName" size="1" onchange="showDiv(this.value);" style="width:100%;font-size:1.0em;">
 <option value="">Select...</option>
 <option value="rm">Royal Mail (UK)</option>
 <option value="pf">Parcel Force (UK)</option>
 <option value="cl">Citylink (UK)</option>
 <option value="il">Interlink Express (UK)</option>
 <option value="tnt">TNT (UK)</option>
 <option value="usps">US Postal Service</option>
 <option value="ups">UPS</option>
 <option value="can">Canada Post</option>
 <option value="fed">Fedex</option>
  </select>
</form>
<div id="rm" class="hiddenDiv">
  <form action="http://www.royalmail.com/portal/rm/track" method="get" name="rm_carrier" id="rm_carrier" target="_blank">
 <input name="trackNumber" type="text" value="Tracking ID" size="12" onfocus="if(this.value=='Tracking ID') this.value='';">
 <input type="submit" name="Submit" value="Go">
  </form>
</div>
<div id="pf" class="hiddenDiv">
  <form action="http://www.parcelforce.com/portal/pw/track" method="get" name="pf_carrier" id="pf_carrier" target="_blank">
 <input name="trackNumber" type="text" value="Tracking ID" size="12" onfocus="if(this.value=='Tracking ID') this.value='';">
 <input type="submit" name="Submit" value="Go">
  </form>
</div>
<div id="cl" class="hiddenDiv">
  <form action="http://www.city-link.com/track_parcel/track_parcel.php" method="get" name="cl_carrier" id="cl_carrier" target="_blank">
 <input name="custref" type="text" value="Tracking ID" size="12" onfocus="if(this.value=='Tracking ID') this.value='';">
 <input type="submit" name="Submit" value="Go">
  </form>
</div>
<div id="il" class="hiddenDiv">
  <form action="http://www.interlinkexpress.com/quick-track.htm" method="get" name="il_carrier" id="il_carrier" target="_blank">
 <input name="qtrack" type="text" value="Tracking ID" size="12" onfocus="if(this.value=='Tracking ID') this.value='';">
 <input type="submit" name="Submit" value="Go">
  </form>
</div>
<div id="tnt" class="hiddenDiv">
  <form action="http://cgi.tnt.co.uk/trackntrace/conenquiry.asp" method="get" name="tnt_carrier" id="tnt_carrier" target="_blank">
 <input value="track" type="hidden" name="action" />
 <input value="c" type="hidden" name="type" />
 <input name="query" type="text" value="Tracking ID" size="12" onfocus="if(this.value=='Tracking ID') this.value='';">
 <input type="submit" name="Submit" value="Go">
  </form>
</div>
<div id="usps" class="hiddenDiv">
  <form action="http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do" method="get" name="usps_carrier" id="usps_carrier" target="_blank">
 <input name="origTrackNum" type="text" value="Tracking ID" size="12" onfocus="if(this.value=='Tracking ID') this.value='';">
 <input type="submit" name="Submit" value="Go">
  </form>
</div>
<div id="ups" class="hiddenDiv">
  <form action="http://www.ups.com/search/quick" method="get" name="ups_carrier" id="ups_carrier" target="_blank">
 <input name="trackNums" type="text" value="Tracking ID" size="12" onfocus="if(this.value=='Tracking ID') this.value='';">
 <input type="submit" name="Submit" value="Go">
  </form>
</div>
<div id="can" class="hiddenDiv">
  <form action="http://www.canadapost.ca/cpotools/apps/track/personal/findByTrackNumber?LOCALE=en" method="get" name="can_carrier" id="can_carrier" target="_blank">
 <input name="trackingNumber" type="text" value="Tracking ID" size="12" onfocus="if(this.value=='Tracking ID') this.value='';">
 <input type="submit" name="Submit" value="Go">
  </form>
</div>
<div id="fed" class="hiddenDiv">
  <form action="http://www.fedex.com/Tracking" method="get" name="fed_carrier" id="fed_carrier" target="_blank">
 <input name="tracknumbers" type="text" value="Tracking ID" size="12" onfocus="if(this.value=='Tracking ID') this.value='';">
 <input type="submit" name="Submit" value="Go">
  </form>
</div>
{/capture}
{include file="customer/menu_dialog.tpl" title="Parcel Tracking" content=$smarty.capture.menu}

Then in /skin1/customer/home.tpl insert...

{include file="customer/track.tpl"}
The website uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy.
More Information