Problems with Liquid in Order Confirmation Emails

Hi there!

I am trying desperately to set up Liquid logic so that my order confirmation emails reflect different messages depending on the shipping method chosen. I offer local pickup, local delivery, and free shipping. I’ve tried multiple iterations to try to get it right, but no matter what I do I can’t seem to get the logic to work properly for all 3 messages. This is the closest I’ve come so far:

Thank you for your order!

{% if order.pickup_in_store? %}

PICKUP MESSAGE

{% elsif checkout.shipping_method.title == ‘Local Delivery‘%}

DELIVERY MESSAGE

{% elsif checkout.shipping_method.title == ‘Free Shipping‘%}

SHIPPING MESSAGE

{% endif %}

This works properly for Local Pickup and Local Delivery, but for Free Shipping it gives me the message for Local Delivery rather than Free Shipping. I know the problem is with the final elsif, because when I switch the line for Local Delivery and Free Shipping then I just get the message for Free Shipping and not Local Delivery. I’ve tried using {% else %} instead of elsif for the final message but that doesn’t seem to work either.

Any help would be greatly appreciated!

Hi There!

Would need a clearer picture here on your shipping methods to be able to write a better analysis here.

Hmm… I’m not quite sure I know what you mean. Both Local Delivery and Local Pickup are Shopify’s own options under the shipping and delivery settings. Free Shipping is a custom domestic shipping rate I created under General Shipping. Does that help?

Finally found a solution! If anyone else ever has this issue, I did mine like this:

Thank you for your order!
{% if requires_shipping %}
{% if shipping_method.title == ‘Free Shipping’%}
Free Shipping Message
{% elsif shipping_method.title == ‘Local Delivery’ %}
Local Delivery Message
{% endif %}
{% if order.pickup_in_store? %}
Local Pickup Message
{% endif %}
{% endif %}

Hi ,

I am also having issues with mine recently. Had it working for years . And even with the new addition from shopify with local pickup it will not fulfill an order from 2 locations . So I can’t use there new feature.

This was my last working bit of code . My shipping rate name is setup identical to Westport Click & Collect

{% if shipping_method.title == ‘Westport Click & Collect’ %}

{% if fulfillment.item_count == item_count %}All{% elsif fulfillment_status == 'fulfilled' %}The last{% else %}Some{% endif %} of the items from order {{ name }} are ready for collection:

{% for line in fulfillment.fulfillment_line_items %}{{ line.quantity }}x {{ line.line_item.title }}
{% endfor %}

{% if requires_shipping %}The order can be collected from the following address:

For Footwear:

Any help would be appreciate.