Hello,
We have recently just completely overhauled how our shipping rates work due to the latest update to the shipping & delivery section.
We are now using the Transit Time option within shopify (pictured below)
We used to have it set up so that it showed the trasnit time as the delivery rate but this new way is alot sleeker and better for the customers.
We are trying to add the transit time to the order confirmation email (customer) and the new order email (staff) so that it is still visable to all.
Can anybody provide the liquid code for this?
1 Like
The transit time you set in Settings > Shipping and delivery gets shown to the customer at checkout, but unfortunately Shopify does not expose that transit time data through Liquid variables in notification templates. There’s no shipping_line.delivery_days or similar object available in the email notification Liquid context.
So the most practical workaround is to bake the transit time into your shipping rate name itself. For example, instead of naming your rate “Standard Shipping” with a separate transit time, name it “Standard Shipping (3-5 Business Days)”. That way when the template renders the shipping method name, the customer and staff both see the transit time inline.
If you want to get fancier and conditionally display transit times based on the shipping method chosen, you can add something like this in your order confirmation and new order notification templates (Settings > Notifications > Order confirmation / New order). You’ll need to check which Liquid variable your template uses for the shipping method title and match against that. For example, if the variable is shipping_method.title:
{% if shipping_method.title contains "Standard" %}
<p>Estimated transit time: 3-5 business days</p>
{% elsif shipping_method.title contains "Express" %}
<p>Estimated transit time: 1-2 business days</p>
{% elsif shipping_method.title contains "Economy" %}
<p>Estimated transit time: 5-10 business days</p>
{% endif %}
Check the existing template source to confirm the exact variable name, then drop the conditional block right after where the shipping method is displayed. You’ll need to match the conditions to whatever your actual rate names are.
It’s not as elegant as pulling the transit time dynamically, but until Shopify adds that data to the notification Liquid objects, this is how you get it done.