window.Shopline

The store data can be retrieved via JavaScript in window.Shopline, containing the following properties.

window.Shopline.currency

Store Currency


window.Shopline.designMode

Whether to be in editor/preview mode, consistent with request.design_mode


window.Shopline.customer

Customer object, defined only when the customer is logged in, same as customer object

{
id: "xxxxx" // customer ID
}

window.Shopline.handle

Store handle


window.Shopline.isLogin

Is the customer logged in


window.Shopline.locale

The current language of the foreground, same as request.locale, has the following priority.

●Language selector is not enabled
Use store default language

●Language selector is enabled
clientLang query > Language selected by language selector > Browser language (preferred browser language must be enabled) > Store default language


window.Shopline.merchantId

Merchants ID


window.Shopline.storeId

Store ID


window.Shopline.theme

Current store theme template global configuration, same as current.theme in config/settings_data.json, accessed by: theme.settings.xxx


window.Shopline.themeId

The theme template ID of the store's current application


window.Shopline.themeName

Name of the theme template currently applied by the store


window.Shopline.themeVersion

The theme template version number currently applied by the store


window.Shopline.updateMode

Whether the theme template of the current application of the store has been changed by the merchant or the code editor


window.Shopline.uri

Current client access path information, same as request.uri

// request url: xxx.com/collections/test-id?page=1
{
alias: "Home", // page alias, same as templateAlias
params: { // url path params
uniqueKey: "test-id"
},
path: "collections/:uniqueKey", // url path rules
query: { // url query params
page: "1",
orderSeq: 'xxxx', // Order Information
keyword: 'xxxx', // Keyword Information
},
url: "/collections/test-id?page=1" // url
}

window.Shopline.event

Event bus for theme template events
Refer to theme-events for usage details

Was this article helpful to you?