location Liquid variable not set in Order Confirmation email

thelab
Tourist
4 0 13

 

This code is used in the Order Ready for Pickup email template (and it works fine):

 

<table class="section--margin">
  <tr>
    <td>
      <h4>Pickup location</h4>
    </td>
  </tr>
  <tr>
    <td>
      <p>{{ location.name }}</p>
    </td>
  </tr>
  <tr>
    <td>
      <p>{{ location.address1 }}</p>
    </td>
  </tr>
  {% if location.address2 != blank %}
  <tr>
    <td>
      <p>{{ location.address2 }}</p>
    </td>
  </tr>
  {% endif %}
  <tr>
    <td>
      <p>{{ location.city | capitalize }} {{ location.province | capitalize }} {{ location.zip | upcase }}</p>
    </td>
  </tr>
  <tr>
    <td class="empty-line"> </td>
  </tr>
  <tr>
    <td>
      <a href="http://www.google.com/maps/search/?api=1&query={{ location.name }} - {{ [location.address1, location.address2].compact.join(', ') }}, {{ location.city }}, {{ location.province }}, {{ location.zip }}" target="_blank">
        Abrir mapa 
        <span class="small">→</span>
      </a>
    </td>
  </tr>
</table>

 

 

However, using the same code in the Order Confirmation email template doesn't work because the variable `location` is not set.

 

Reading the docs, the variable should be available: https://help.shopify.com/en/manual/sell-online/notifications/email-variables#order-fulfillment

 

Many properties of an order are available directly using Liquid, in templates, and in additional scripts.

The properties of an order are available in the following templates:

  • Order confirmation
location (POS only)

Displays the physical location of the order. There are several location properties available, listed here. You can configure locations in the Locations area of the admin.

0 Likes
anthonyywl
New Member
1 0 0

I have same problem. Who could be help us?

0 Likes
HelloPaul
Tourist
26 0 1

I also have this same problem! Why is {{ location.name }} not available in the order confirmation email??

0 Likes
CRagsdell
Tourist
16 0 1

Could someone from Shopify please reply to this thread?

My client is requesting the information be added in the order notification email sent to their customer service, and didn't like hearing "it isn't available in the code".

The is E-commerce 101 stuff, folks...

Thanks in advance.

0 Likes