How To Implement Order Tracking In Shopware 6?

Order Tracking In Shopware 6

Customers can view the order status by using the tracking function which the shipment company provides. By clicking on the tracking link you can see all the updates on your order. To implement the order tracking function in shopware 6 follow the below instructions.

Find the tracking link

To find out what the tracking link is, you can generally check with the company whose shipping system was named in the order. In most cases, you can simply go to the online site of the company and enter the shipment number. We are going to use the DHL shipment tracking function.

This tracking link is

https://www.dhl.de/en/privatkunden/pakete-empfangen/verfolgen.html?piececode=12345678

where ‘12345678’ is the tracking number.

Adding the tracking link to the email template

To add the tracking link to the email template, you have to go to the Settings > Email templates. I’m inserting the tracking link into the mail template “Entry delivery status: shipped”.

For the Plain text field, you can use the following example code, in which the variable for the tracking number “trackingCode” is output.

{% for delivery in order.deliveries %}
	{% for trackingCode in delivery.trackingCodes %}
		https://www.dhl.de/en/privatkunden/pakete-empfangen/verfolgen.html?piececode={{ trackingCode }}
	{% endfor %}
{% endfor %}

For the HTML field, you can use the following example code.

{% for delivery in order.deliveries %}
	{% for trackingCode in delivery.trackingCodes %}
		Sendungsverfolgung: <a href="https://www.dhl.de/en/privatkunden/pakete-empfangen/verfolgen.html?piececode={{ trackingCode }}">{{ trackingCode }}</a></br>
	{% endfor %}
{% endfor %} 

Enter the tracking number in the order details.

You have to add the tracking number on the order from the admin in Order > Overview

The tracking number is located in the customer’s storefront under orders.

Please contact us at manish@bay20.com or call us at +91-8800519180 for any support related to shopware. You can also visit the Shopware development page to check the services we offer.