window.Shopline
The window.Shopline object exposes store-specific information. This article introduces the properties of this object.
window.Shopline.customer
An object containing customer information. This object is populated only if a customer is logged in. It includes the following properties:
{
id: "*******890", // The customer ID
email: "********@example.com", // The customer's email address
phone: "+1123-***-789" // The customer's phone number
}
window.Shopline.designMode
Indicates whether the storefront is currently being viewed in the theme editor's preview mode. This value corresponds to the request.design_mode property.
window.Shopline.extension
An object containing information about the utilities related to theme app extensions on the current page. It includes the i18nInit and t properties.
window.Shopline.extension.i18nInit
A method used to initialize the language pack for a specific app extension on the current page. It asynchronously fetches the extension's localized JSON data from the server. For more information, refer to Fetching language packs.
window.Shopline.extension.t
A method used to retrieve localized translation strings for a specific app extension on the current page. For more information, refer to Fetching language packs.
window.Shopline.handle
The store's handle, which is the prefix of the store's base URL. For example, if the store's domain is demo.myshopline.com, the handle is demo.
window.Shopline.i18nInit
A method used to initialize the theme's language pack for the current page. It asynchronously fetches the theme's localized JSON data from the server. For more information, refer to Fetching language packs.
window.Shopline.storeId
The store ID.
window.Shopline.t
A method used to retrieve localized translation strings for the theme on the current page. For more information, refer to Fetching language packs.
window.Shopline.uri
An object containing routing and path information for the current page. It includes the properties in the following sections:
window.Shopline.uri.alias
The alias of the page. The following table describes the mapping between page paths and their corresponding aliases:
| Page path | Alias |
|---|---|
| / | Home |
| /password | Password |
| /proofing | Proofing |
| /404 | 404 |
| /cart | Cart |
| /search | ProductsSearch |
| /products/{productHandle} | ProductsDetail |
| /collections-all | AllCollections |
| /collections/{collectionHandle} | Products |
| /gift_cards/:storeId/{handle} | GiftCard |
| /blogs/{blogHandle} | BlogsList |
| /blogs/{blogHandle}/{articleHandle} | BlogsDetail |
| /pages/{handle} | Page |
| /policies/{handle} | Policy |
| /user/signIn | SignIn |
| /user/signUp | SignUp |
| /user/activate | ActivateAccount |
| /user/passwordNew | PasswordNew |
| /user/center | Center |
| /user/company | Company |
| /user/address/new | AddressNew |
| /user/address/:addressSeq/edit | AddressEdit |
| /user/orders | OrderList |
| /user/orders/:id | OrderDetail |
window.Shopline.uri.root_url
The root URL of the page. For example, the root URL for the storefront page in the theme editor's preview mode is /preview.
window.Shopline.uri.params
The route parameters of the page.