Tracktor: Add Tracktor button to the Order Status page

Follow the steps below to add a View Order Updates button to your order status page.

1. Starting from your Shopify admin dashboard, head to the Settings tab in the left sidebar.

2. Click on the Checkout section.

3. Scroll down to the Additional Scripts setting.

4. Add the following code snippet below.

{% if order.phone %}
  <script>
    Shopify.Checkout.OrderStatus.addContentBox(     
       '<h2>Order Status & Tracking</h2>',    
       '<p><a href="{{shop.url}}/apps/tracktor/track?token={{ order.phone | split: "" | reverse | join: "" | url_encode }}&order={{ order.name | url_encode }}" class="btn">View Order Updates</a></p>'   
    )
  </script>
{% else %}
  <script>
    Shopify.Checkout.OrderStatus.addContentBox(     
      '<h2>Order Status & Tracking</h2>',     
      '<p><a href="{{shop.url}}/apps/tracktor/track?token={{ email | split: "" | reverse | join: "" | replace: '@', '_-_' | url_encode }}&order={{ order.name | url_encode }}" class="btn">View Order Updates</a></p>'   
    ) 
  </script>
{% endif %}

5. Click the Save button at the bottom of the page.

Now your Order Status page will have a Tracktor button in it!