How to add pick up location details to my Shopify order confirmation email?

Jun 14, 2023

Background


Shopify’s confirmation email default content doesn’t include the pick-up location when your buyers choose pick-up as their shipping method at Checkout.

Pick-up locations can only be viewed on the order confirmation page, which can be accessed from the order confirmation email.

What if you wanted to replace the shipping address section with the pick-up location so your buyers can see it right away, without having to go to the order confirmation page?


How to

When your buyer selects a pick-up location, it can be accessed through the order.shipping_method.title liquid attribute from the order confirmation email. We’ll use this attribute to display our pick-up location

When an order has a pick-up location, it has no shipping address. One section we could display the pick-up location is under the shipping address section since there’s no shipping address to display.

Open your Shopify Admin, go to Settings > Notifications > Order Confirmation

From there click Edit Code, and place your cursor in the Email Body section. Press ctrl + F to search for shipping_address . Find the following code block

{% if requires_shipping and shipping_address %}   
  <td class="customer-info__item">     
    <h4>Shipping address</h4>     
    {{ shipping_address | format_address }}    
  </td> 
{% endif %}

Replace it with

{% if requires_shipping and shipping_address %}   
  <td class="customer-info__item"> 
    <h4>Shipping address</h4>    
    {{ shipping_address | format_address }}   
  </td> {% elsif order.shipping_method.title %}   
  <td class="customer-info__item"> 
    <h4>Pick Up Location</h4>    
    {{ order.shipping_method.title }}   
  </td> 
{% endif %}

Testing

Since the test order used in the preview mode of the email editor doesn’t contain a pick-up location, we won’t be able to test our changes in preview mode.

Instead, go to one of your store’s orders that has a pick-up location. Scroll down to the Timeline, find the order confirmation email, and click Resend Email. You’ll be prompted to re-send the email to your own email address. Check your mailbox and make sure it looks good.