Global
The global
object provides access to all global objects and settings available in your store’s Liquid environment. These objects can be accessed from any file in your theme and are essential for building dynamic storefronts.
Usage Example
{%- comment -%} Access the main navigation menu and render its links {%- endcomment -%}
{% assign menu = linklists['main'] %}
<ul>
{% for link in menu %}
<li><a href="{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
{%- comment -%} Show the current page title {%- endcomment -%}
<title>{{ page_title }}</title>
{%- comment -%} Show the signed-in customer's name {%- endcomment -%}
{% if customer %}
<p>Welcome, {{ customer.name }}!</p>
{% endif %}
Properties
additional_authentication_flows
Returns whether there are any additional authentication flows.
available_order_statuses
Lists available order statuses.
available_return_reasons
Lists available return reasons.
available_return_statuses
Lists available return statuses.
blog
Access the store’s blog.
cart
Returns the cart object.
catalog
Access the product catalog of the store.
product_groups
Access information about the product group list in the store.
content_for_additional_authentication_flows
Returns the content for additional authentication.
content_for_additional_checkout_buttons
Returns the content for the additional offsite checkout buttons. These are buttons that are not part of the standard checkout flow.
content_for_financing_offers
Returns the content for the financing offers. To see product level financing offers, use the product variant drop.
content_payment_option_banners
Returns the content for the payment options banners.
country_option_tags
Lists all the available country options. Country regions are rendered in regions data attribute.
Input
<select name="country">
{{ country_option_tags }}
</select>
Output
<select name="country">
<option value="fi" data-regions='[]''>Suomi</option>
<option value="us" data-regions='[["al", "Alabama"],..]'>United States</option>
</select>
current_page
Returns the current page number when a paginated collection is being viewed. Returns 1 if not paginated.
customer
Access the signed in customer information.
has_additional_checkout_buttons
Returns whether there are any additional offsite checkout buttons. These are buttons that are not part of the standard checkout flow.
has_payment_options
Returns whether there are any payment options.
linklists
Returns the linklists for the current store.
{% assign menu = linklists['main'] %}
{% for link in menu %}
{% comment %}do something with the link{% endcomment %}
{% endfor %}
manufacturers
Returns a manufacturer list of all manufacturers in the store.
page_title
Returns the title for the current page.
<title>{{ page_title }}</title>
pages
List available pages in the store.
powered_by_link
Returns the powered by link.
{{ powered_by_link }}
products
Access common lists and specific products in the store. To list all products, see catalog.
rendered_partial
Returns the partial that is being rendered. For example, if the partial is product section, it will return ‘sections/product’. This is only defined when rendering a partial and not in full page render.
request
Returns the information about the current request to page, like host or the current URL.
routes
Returns the routes object which provides URLs for the endpoints needed in the store.
session
Access information about the current session
settings
Access theme settings.
store
Returns the store object.
submitted_form
Returns last form submission result and data.
Input
{{ submitted_form.id }}
{{ submitted_form.error }}
{{ submitted_form.posted_successfully? | yepnope: 'yes', 'no' }}
Output
login
email
no
template
Returns information about the current template used at the page.
wishlist
Returns the wishlist object. Returns false if customer is not signed in.