How to add a track order link in the customer account
Enter your Shopify store admin and enter the Themes menu: Store admin -> Online Store -> Themes
Click the Actions button then select the Edit code from the drop-down menu
After selecting the Edit code menu then select the Templates folder
To add a track order link to a customer account: Click the arrow button in the upper right corner to enlarge the screen then select customers/account.liquid
Look for line 32 or the same code as in the image below then press Enter before the end of the tag
Then copy and place the code below {% if order.fulfillment_status_label == 'Fulfilled' %} <a href="#" class="tracking_order" data-shop_name="{{shop.permanent_domain}}" data-order_number="{{order.order_number}}" data-email="{{order.email}}" >Track Order </a> {% endif %}
Then click Save
The javascript code below is also placed at the end of the file and hit the Save button <script type="text/javascript" src="//indocolite.myindoapps.com/application/views/js/custom/customer_trackorder.js"></script>
The following is the customer account page and the order history after the customer logs in with the URL: your-website-name/account, if the code placement is correct, the Track Order button will appear as shown below:
When you click the Track Order button you will be redirected to the order tracking page as shown below: