Using global Liquid tags
On this page
The following global context variables are available in every Liquid render in StoreConnect — both in web theme templates and in POS action parameter expressions. They return a drop of the appropriate type, or nothing, so you can use them in if statements:
liquid
{% if current_customer %}
Hi {{ current_customer.firstname }}!
{% endif %}
Global context variables
| Variable | Description |
|---|---|
current_store (also store) |
The current store |
current_cart (also cart) |
The active cart, if any |
current_customer (also customer) |
The logged-in customer contact, if any |
current_account (also account) |
The logged-in customer’s account, if any |
current_membership (also membership) |
The customer’s active membership, if any |
current_pricebook |
The pricebook active for the current context |
current_order |
The current order (available in order confirmation and receipt contexts) |
current_request |
The HTTP request (URL, params, headers) |
session_variables |
Key-value pairs stored in the customer session |
store_variables |
Key-value store configuration variables |
theme_variables |
Key-value theme configuration variables |
login |
The current login session |
navigation |
The store navigation menus |
current_page |
The current page record, when on a page template |
current_product |
The current product, when on a product template |
current_product_category |
The current product category, when on a category template |
current_article_category |
The current article category, when on an article category template |
current_outlet |
The current outlet — available in POS Liquid templates and sync scope filters |
current_register |
The current register — available in POS Liquid templates and sync scope filters |
:::note
The current_ prefix forms are preferred and are always available. The shorter aliases (store, cart, customer, account, membership) are available for backward compatibility in web theme templates.
current_outlet and current_register are available only in POS contexts. They are not populated in web theme templates.
:::
Dynamic URLs
If you have multiple stores that each make use of the same code, you can use liquid for your domain name in URL links. This will create the URL link dynamically, based on the domain of the store the code is being used in:
href=“{{ current_store.domain }}“
href=“{{ current_store.domain }}/slug”
Globaldrop finders
The following finders are available on all StoreConnect pages. They either return a the product or nothing which means you can use liquid if statements easily, for example:
{% assign product = all_products["my_featured_product"] %}
{% if product %}
Was {{ product.formatted_original_price }}, now {{ product.formatted_sale_price }}
{% endif %}
The following global finders are available:
all_productsall_product_categoriesall_pagesall_articlesall_content_blocksall_media