Skip to main content

Global Models

Prodyflow provides global variables that are always available in your Twig templates. These variables give access to webshop data, request information, and localization settings generated by the backend.

Global models allow you to build dynamic templates without writing backend code — all core page and webshop values are accessible directly in Twig.

VariableDescription
canonical_urlCanonical page URL for SEO
page_titleTitle of the current page
page_descriptionMeta page description of the current page
requestrequest data
localeActive locale details
supported_localesAll supported languages for the webshop
is_single_languagetrue when the sale channel has one language: its URLs have no language segment (/{slug}/...)
webshopWebshop details
sale_channelsList of all webshop sale channel

Locale​

Prodyflow provides localization information for your webshop, including the currently active language and a list of all supported locales.

VariableDescriptionComment
codeReturns the currently active language code, e.g., en, hu.Only for the current locale, for supported_locales this is the array key
nameReturns the full name of the current locale, e.g., English.
nativeReturns the native name of the current locale, e.g., Magyar.
scriptReturns the script of the locale, e.g., Latn.
regionalReturns the regional variant of the locale, e.g., en_GB.

request​

VariableDescriptionComment
iso_codeThe current locale code, e.g., en, hu.Used for language-specific rendering.
originThe origin URL of the request.Typically includes protocol + host, e.g., https://example.com.
hostThe host of the request, e.g., example.com.Useful for multi-domain setups.
pathThe path of the request URI.Example: /products/123.
full_urlFull URL of the current request including query parameters.Example: https://example.com/products/123?ref=homepage.
queryAssociative array of GET query parameters.Example: ['ref' => 'homepage'].
methodHTTP method of the request.Example: GET, POST.
schemeProtocol of the request.Example: http or https.
is_secureWhether the request came over HTTPS.Boolean.
country_codeCode of the country based of the visitor's IP addressExample: hu or de.
route_nameName of the current pageExample: product.

webshop​

VariableDescriptionComment
nameThe display name of the webshop.Example: My webashop.
sale_channelThe sales channel object
sale_channelsThe list of all sale channels of the webshopSee below
channel_switcherThe rows and the label of the channel switcherSee below

Webshop Sale Channel Properties​

VariableDescriptionComment
nameName of the sale channel
domainDomain of the sale channel
slugSlug used for URLsNullable
faviconFavicon URLNullable
logoLogo URLNullable
currencyDefault currency code (e.g., USD, EUR)
default_languageDefault language code (e.g., en, hu)
is_changeIndicates if the webshop supports product/exchange changesBoolean
is_returnIndicates if the webshop supports returnsBoolean
is_international_codIndicates if international cash-on-delivery (COD) is supportedBoolean
return_allowed_daysNumber of days allowed for returning productsInteger
phoneContact phone numberNullable
emailContact email addressNullable
idID of the sale channel
dispute_allowed_daysNumber of days a customer can report a problem with a delivered orderNullable integer
show_ticketsThe help page lists the customer's ticketsBoolean
show_chatThe webshop chat is on: render the chat panel only when it is (see chat.js in Config)Boolean
countryThe sale channel's own country (the shipping default, not the visitor's): id, code, name, local_nameNullable
free_delivery_overFree delivery from this order amount (the lowest amount of a free delivery price), null when there is noneNullable number
channel_switcherWhat the channel switcher offers: sale_channels or countriesString

Sale Channels​

webshop.sale_channels is the short list of all sale channels:

VariableDescriptionComment
idID of the sale channel
nameName of the sale channel
slugSlug used for URLsNullable
currencyCurrency code of the sale channel
is_defaultThe default sale channelBoolean

Channel Switcher​

webshop.channel_switcher has everything a switcher needs. What it offers is the sale channel's channel_switcher setting: the sale channels, or the countries they deliver to (the country decides the channel).

VariableDescription
modesale_channels or countries
labelThe text of the switcher's button: the current sale channel's name, or the chosen country (the ship_country cookie), or the only country of the channel
itemsThe rows. Every row has url, the same page on the target channel, name, currency and current (the row of this channel). In countries mode a row is a country with its own label and the link to the channel that delivers there.

JavaScript globals​

The engine puts a few values on window for the template's scripts:

GlobalDescription
window.SHOP_BASEThe sale channel's link prefix: /{language}/{slug}, or /{slug} on a channel with one language. Use it for links built in JS (window.SHOP_BASE + '/profile').
window.lanThe language code of the page
window.MONEY_FORMATThe money format rules of the template (only when the template sets them)