Add track button to PrestaShop store (version 1.7.6.5)

PrestaShop is an open-source eCommerce solution. Add the AfterShip track button to your store and streamline order tracking for customers across 700 couriers worldwide

🔧 Insert track button to Order History Page

Edit Theme File (order-detail.tpl)

  1. Go to the start menu > FTP > Select your FTP location > Theme folder > Search for order-detail.tpl file
  2. Search for the following code
<td>{$line.trackingnofilter}</td>

Replace it with the below-mentioned code snippet and save changes

<td>{if $line.tracking&& $line.tracking !== '-'}{literal}<divid="as-root"></div><script>(function(e,t,n){var r,i=e.getElementsByTagName(t)[0];if(e.getElementById(n)){aftership.buttonCreator.create();return;}r=e.createElement(t);r.id=n;r.src="//button.aftership.com/all.js";i.parentNode.insertBefore(r,i)})(document,"script","aftership-jssdk")</script>{/literal}<div class="as-track-button" data-domain="track.aftership.com" data-size="small" data-tracking-number="{$line.tracking}"></div>{else}-{/if}</td>

❗ Failed to add track button

If the track button is not added after the modification of FTP file, follow the below-mentioned steps. 

  1. Go to PrestaShop admin panel > Advanced parameters > Performance > Clear cache
  2. Recompile templates if the files have been updated > Save changes
Was this article helpful?
0 out of 0 found this helpful