Liquid Template Variables - request

From Spiffy Stores Knowledge Base

The Liquid template variable request has the following attributes:

request.parameter

You can access any request parameter by name.

For example, a URL can include a parameter:

http://storedemo.spiffystores.com/?theme=blue

This theme parameter can be accessed by

request.theme

request.host

Returns the host name portion of the URL request.

For example, if we go to http://storedemo.spiffystores.com, then the request.host returns:

storedemo.spiffystores.com

request.url

Returns the complete URL used for this request.

For example, if we go to http://storedemo.spiffystores.com/products/widget, then the request.url returns:

http://storedemo.spiffystores.com/products/widget

request.remote_ip

Returns the IP address of the client accessing the page.

request.country

Returns the Country name of the user accessing the page. This information is determined from the IP address, and may not be accurate in all cases. Typically, the results are 99.5% accurate.

The name returned is the ISO Printable name. For example:

Australia

request.country_code

Returns the two character ISO Country Code of the user accessing the page. This information is determined from the IP address, and may not be accurate in all cases. Typically, the results are 99.5% accurate.

The code returned is the ISO Code. For example:

AU

request.city

Returns the City name of the user accessing the page. This information is determined from the IP address, and may not be accurate in all cases. Typically, the results are 79% accurate. For example:

Sydney

request.timezone

Returns the Time Zone of the user accessing the page. This information is determined from the IP address, and may not be accurate in all cases.

The name returned is the standard timezone name. For example:

Australia/Sydney

request.currency

Returns the local currency of the user, based upon the Country from which the client has accessed the page. This information is determined from the IP address, and may not be accurate in all cases.

AUD

request.user_agent

Returns the user agent string of the user's browser. Each browser returns a unique user agent string, which provides information about the version and features that the browser provides.

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0