Skip to main content

Page Variables

In eCommerce, page variables are essential for creating a dynamic and personalized shopping experience. These variables are defined and managed in the backend using Flask and rendered on the front-end using Jinja2.

Global Variables

Because it's impossible to list all of the available variables, here is a short summary of the most used ones.

context

This is the global context, defined by Flask and extended by our backend.

KeyDescription
CMS_MODEbool: Are you logged into the CMS?
CHECKOUT_V2bool: Is CHECKOUT_V2 active?
use_basic_basket_overviewbool: True => Use a basic version of the basket, without calculating sale totals.
semi_secure_endpointsList: UNUSED
tagsList<Dict>: A list of all the active product tags
nav_itemsList<Dict>: A list of all the available trees, in the correct structure.
page_nav_itemsList<Dict>: A list of all the nested CMS pages.
authDict: An object that contains information about order possibilities.
basketDict: An object that contains all the basket data.
outletsList<Dict>: A list that contains all the configured outlets.
active_sale_countint: An indication of how many sales the user has.
active_invoice_countint: An indication of how many invoices the user has.
wishlistList<Dict>: A list of products that the user has in their wishlist.
edit_modestr: The ID of the sale that a supervisor is editing.
party_infoDict: Contains all info of the party of the user.
ip_countrystr: The country based on the user's IP address.
country_suggestionDict: Suggested country based on the user's IP address.
cookie_prefsList<str>: A list of cookies accepted in the cookie consent.
cookies_acceptedstr: UNUSED
is_mobilebool: Is the UserAgent of the request a mobile device?
experimentalbool: UNUSED
request_mobilebool: Does the cookie cs_mobile exist?
recent_productsList<Dict>: A list of recently viewed products.
js_translationsDict: A fixed object with translations that can be used in JavaScript by using window.js_translations
first_available_delivery_datestr: First available delivery date.
delivery_daysList<int>: Index of days that are set as delivery days.
non_delivery_daysList<int>: Index of days that are not set as delivery days.
show_price_date_selectorbool: Is select_price_date checked in the shop settings?
available_payment_methodsList<Dict>: Payment methods linked to the shop's payment configuration.
price_dateDate: First available delivery date.
segmentsList<Dict>: List of segments linked to CMS user.
active_segmentDict: Active segment.
active_segment_groupsList<Dict>: List of grouped segments.
cloudflarebool: Is CloudFlare active?
show_basket_cumulated_countbool: Show the combined count of products?
favourite_order_templatestr: ID of the favourite order template.

g.context

KeyDescription
domain_identifierstr: The domain
unit_price_fieldstr: UNUSED
unique_search_attributesList<int>: A list of IDs of uniquely searchable attributes.
shopDict: All information related to the current shop.
metadataDict: Information about SEO texts.
languageDict: Language ID and Code.
available_languagesDict: All available languages.
allowed_languagesList<Dict>: List of allowed languages.
language_groupsDict: Languages grouped by language code.
language_code_mapDict: Languages formatted as 2-code.
allowed_countriesDict: All countries allowed for a shop.
language_catalogDict: Language-specific catalogs.
language_tree_rootDict: Language-specific trees.
language_referenceDict: Internal references for languages.
language_campaignDict: Language-specific campaigns.
fixed_delivery_outletsbool: If True, then just the outlets are available for delivery addresses.
cms_variablesDict: Language-specific variables.
meta_variablesDict: Language-specific meta-variables.
localestr: Locale code (nl_NL).
locale_code_shortstr: Short locale code (nl).
locale_defaultstr: Default locale code.
locale_formatstr: Date format in Python notation.
locale_format_indicatorstr: Date format indicator.
datepicker_formatstr: Date format in JS notation.
companyint: ID of the company related to the shop.
currencyDict: Currency related to the company.
shop_currencyDict: Currency related to the shop.
catalogList<Dict>: List of catalogs before login.
exclude_catalogsList<Dict>: List of excluded catalogs before login.
preorder_catalogsList<Dict>: List of preorder catalogs.
exclusive_catalogsList<Dict>: List of exclusive catalogs.
search_exclude_catalogsList<Dict>: List of search excluded catalogs.
bundle_configDict: Bundle configuration for a product.
cs_party_originstr: ID of the party_origin linked to the shop's company.
picture_uploadbool: Is the picture upload active?
settingsDict: All shop-based settings.
partyDict: Information related to the default party.
default_party_dataDict: Pricing information related to the default party.
saleDict: Information about pricing settings.
authDict: Information about the default user role.
featuresList<str>: List of all active features:

relevance, lateral_behaviour, rma, contracts, headless, sales_center, quotations, template_products
searchDict: Search configuration.
api_profileDict: Information about external API configurations.
ga4_idstr: GA4 ID.
external_interfaceDict: Configuration for the External Price Interface.
email_campaignDict: Configuration for email campaigns.
payment_providerDict: The payment provider linked to the domain or shop.
default_stock_indicationint: The ID of the default stock indication.
stock_textDict: UNUSED
after_login_pagebool: If True, then a custom page or overlay will be presented after login.
enterprise_domainDict: Information about the enterprise domain.
testingbool: Flag for using E2E tests.
nocachebool: Flag for using E2E tests.

g.user

KeyDescription
user_idint: ID of the user.
user_namestr: Full name of the user.
user_first_namestr: First name of the user.
user_middle_namestr: Middle name of the user.
user_last_namestr: Last name of the user.
user_emailstr: Email address of the user.
email_confirmedbool: Has the user confirmed their email address?
user_date_of_birthDateTime: The date of birth of the user.
account_activebool: Is the user's account active?
login_popupDict: Login popup configuration.
login_popup_choicestr: Choice made in login popup.
punchout_userbool: Is the user a punchout/OCI user?
punchout_user_typestr: Punchout type.
punchout_parametersDict: Punchout parameters.
languageDict: Chosen language of the user.
localeDict: Chosen locale of the user based on the language.
locale_formatstr: Locale format of the user in Python format.
locale_format_indicatorstr: Locale format of the user in JavaScript format.
custom_indexbool: Does the customer have an external product index?
party_indexbool: Does the customer have an external party index?
category_indexbool: Does the customer have an external category index?
currencyDict: Currency information of the user.
partyDict: Information related to the user's party.
saleDict: Sale settings of the user.
catalogList<Dict>: List of catalogs linked to the user.
exclude_catalogsList<Dict>: List of excluded catalogs linked to the user.
allowed_catalogsList<Dict>: List of allowed catalogs linked to the user.
supervised_catalogsList<Dict>: List of supervised catalogs linked to the user.
select_supervised_catalogsList<Dict>: List of selectable supervised catalogs linked to the user.
visible_supervised_catalogsList<Dict>: List of visible supervised catalogs linked to the user.
no_supervision_catalogsList<Dict>: List of catalogs linked to the user.
superuserbool: Is the user a superuser?
select_sale_userbool: Does the user need to select a user for a sale?
test_userbool: Is the user a test user?
debug_accessbool: Allows access to debugging tools.
internal_userbool: Internal users can use the Web-order module of the Web shop, while Web Portal Supplier users have access to that webshop module.
genderstr: The gender of the user (male or female).
web_order_typestr: Which type of orders are allowed during Web Order Entry.
supervisorbool: Is the user a supervisor?
budgetint: ID of the user's budget.
autosaveint: Autosave database record ID.
registration_formsDict: Information about allowed registration forms.
featuresDict: Information about ordering: web_orders, superusers, budgets.
authDict: UserRole settings.

Other Variables

If you're looking for more specific variables that are maybe page-specific, you can easily find them by logging into the CMS and opening the page variables. This contains a list of all the available variables for that page.

Anonymized Information

Some information may be hidden, as it can contain sensitive data.