All things Shopify and commerce
Hi guys,
I'm not an expert coder and was hoping someone out there could point me in the right direction. I have a shipping confirmation email that works fine when I only use one courier, but when I use more than one courier for an order it mixes everything up and looks really bad. Currently in this scenario it lists the courier companies first, then lists the tracking numbers, both separated by commas - it looks like below:
Courier Company: UPS, FedEx
Tracking number: 123, ABC
This is really hard for the customers to untangle.
What I'm looking to do is to present each courier separately so it looks like:
Courier Company: UPS
Tracking number: 123
Courier Company: FedEx
Tracking number: ABC
Can anyone out there help? Any thoughts or suggestions would be really appreciated.
I've included my current code below:
{% if fulfillment.tracking_numbers.size > 0 %}
<p class="disclaimer__subtext">
{% if fulfillment.tracking_numbers.size == 1 and fulfillment.tracking_company and fulfillment.tracking_url %}
Courier Company: {{ fulfillment.tracking_company }}<br>Tracking number: <a href="{{ fulfillment.tracking_url }}">{{ fulfillment.tracking_numbers.first }}</a>
{% elsif fulfillment.tracking_numbers.size == 1 %}
Tracking number: {{ fulfillment.tracking_numbers.first }}
{% else %}
{{ fulfillment.tracking_company }} tracking numbers:<br />
{% for tracking_number in fulfillment.tracking_numbers %}
{% if fulfillment.tracking_urls[forloop.index0] %}
<a href="{{ fulfillment.tracking_urls[forloop.index0] }}">
{{ tracking_number }}
</a>
{% else %}
{{ tracking_number }}
{% endif %}
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024