Difference between revisions of "Liquid Template Variables - address"

From Spiffy Stores Knowledge Base

m
Line 1: Line 1:
 
Address objects are found in order confirmation emails and the ''Additional Content & Scripts'' section of the Checkout.
 
Address objects are found in order confirmation emails and the ''Additional Content & Scripts'' section of the Checkout.
 +
 +
Customers will also have one or more addresse objects.
  
 
Example usage:
 
Example usage:
Line 46: Line 48:
 
== <code>address.address2</code> ==
 
== <code>address.address2</code> ==
  
The second line of the address.
+
The second line of the address. Nil is returned if a second address line does not exist.
  
 
== <code>address.company</code> ==
 
== <code>address.company</code> ==
  
The company name, if supplied.
+
The company name, if supplied. Nil is returned if a company name does not exist.
  
 
== <code>address.city</code> ==
 
== <code>address.city</code> ==
Line 58: Line 60:
 
== <code>address.province</code> ==
 
== <code>address.province</code> ==
  
The full name of the province, state or region. This is not an abbreviated value.
+
The full name of the province, state or region. This is not an abbreviated value. Nil is returned if a province, state or region does not exist.
 +
 
 +
== <code>address.province_code</code> ==
 +
 
 +
The standard ISO abbreviation for the province, state or region. Nil is returned if a province, state or region does not exist.
  
 
== <code>address.zip</code> ==
 
== <code>address.zip</code> ==
Line 67: Line 73:
  
 
The full name of the country. This is not an abbreviated value.
 
The full name of the country. This is not an abbreviated value.
 +
 +
== <code>address.country_code</code> ==
 +
 +
The standard ISO abbreviation of the country.
  
 
== <code>address.phone</code> ==
 
== <code>address.phone</code> ==
  
 
The phone number, if supplied.
 
The phone number, if supplied.

Revision as of 13:04, 10 June 2014

Address objects are found in order confirmation emails and the Additional Content & Scripts section of the Checkout.

Customers will also have one or more addresse objects.

Example usage:

Format an address object for displaying in a confirmation email:

Shipping address:
  {{ shipping_address.name }}
  {{ shipping_address.street }}
  {{ shipping_address.city }}, {{ shipping_address.province }}  {{ shipping_address.zip }}
  {{ shipping_address.country }}
  {{ shipping_address.phone }}

Reference

address.name

Name of the addressee.

You can also use address.first_name and address.last_name to access the individual parts if you want to display the customer name with special formatting.

Example usage:

{{ billing_address.last_name }}, {{ billing_address.first_name }} => Bloggs, Fred

address.first_name

The first name of the addressee.

address.last_name

The last name of the addressee.

address.street

The street address of the addressee.

This is a combined address, made up of both address1 and adress2.

address.address1

The first line of the address.

address.address2

The second line of the address. Nil is returned if a second address line does not exist.

address.company

The company name, if supplied. Nil is returned if a company name does not exist.

address.city

The city of the addressee.

address.province

The full name of the province, state or region. This is not an abbreviated value. Nil is returned if a province, state or region does not exist.

address.province_code

The standard ISO abbreviation for the province, state or region. Nil is returned if a province, state or region does not exist.

address.zip

The Zip or Postal code.

address.country

The full name of the country. This is not an abbreviated value.

address.country_code

The standard ISO abbreviation of the country.

address.phone

The phone number, if supplied.