Answers.Body: <p>I received an answer on Slack from Stephen Callendar.</p>
  
  <pre><code>{% set addresses = craft.commerce.customer.addresses %}
  {% for address in addresses %}
    {% if address.getState() %}
      {{ address.getState().abbreviation }}
    {% endif %}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-17T18:30:51.030Z
Answers.LastActivityDate: 2018-05-17T18:30:51.030Z
Answers.UserDisplayName: John Johnson
Body: <p>Folks, this has to be easier than I've made it. In a front-end template, how do you grab a state abbreviation from a customer's address in Craft Commerce?</p>
  
  <pre><code>{$ set addresses = craft.commerce.customer.addresses $}
  {% for address in addresses %}
    &lt;-- this is where I want to show the abbreviation --&gt;
    {{ address.state.abbreviation }}
  {% endfor %}
  </code></pre>
  
Tags: <plugin-craftcommerce>
Title: How to render a state abbreviation in Craft Commerce?
ThreadText: # How to render a state abbreviation in Craft Commerce?
  
  (Asked by: username_0 on 2018-05-17)
  
  Folks, this has to be easier than I've made it. In a front-end template, how do you grab a state abbreviation from a customer's address in Craft Commerce?
  
  ```
  {$ set addresses = craft.commerce.customer.addresses $}
  {% for address in addresses %}
    <-- this is where I want to show the abbreviation -->
    {{ address.state.abbreviation }}
  {% endfor %}
  
  ```
  
  **Tags:** plugin-craftcommerce
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-05-17. Score: 1 | Accepted answer
  
  I received an answer on Slack from Stephen Callendar.
  
  ```
  {% set addresses = craft.commerce.customer.addresses %}
  {% for address in addresses %}
    {% if address.getState() %}
      {{ address.getState().abbreviation }}
    {% endif %}
  {% endfor %}
  
  ```
  
  
  ---
  
  