-
Notifications
You must be signed in to change notification settings - Fork 3
General services
As part of your theme development process, and in order to make development easier, you are given access to services provided by uStore.
All services are located under the ustore-internal folder. You should not make any changes to the content of this folder. Make sure to use the service without touching the code.
themeContext – Exposes the theme’s current state:
- languageCode – Language code as shown in the URL (i.e. en-US).
- storeFriendlyID – Friendly ID of the current store.
- storeID – GUID of the current store.
- page – Currently displayed page, i.e Home, Category, Cart.
- classicUrl – URL of uStore legacy store.
- securityToken - Token used for the API calls.
utils – General utilities in the application:
- getCookie - Get cookies from the browser.
- deleteCookie – Delete cookies by name.
- setCookie – Set cookies in the browser by key and value.
urlGenerator – Enables to generate store URLs.
You can use it in the tag in order to redirect to another page in the store.
For example:
<Link to={urlGenerator.get({page:'category', id:12})}> The get function of this service can receive two parameters: page (mandatory) and Id (optional). The page parameter is the page name. The page name must be in kebab case (i.e. products-list), as opposed to the page’s name in the routes folder, which uses pascal case (i.e. ProductsList).
The second parameter is the Id of the page, and in this example it is the category Id.
If you wish to get the Id of the current page, do so by using the themeContext service:
contextService.getValue("id")The following is the return value of the above example:

uStore NG Themes
uStore NG Extensibility
Theme customization overview
Editing CSS variables
Editing the CSS
Migration from Legacy to NG
Theme development overview
Getting started
Theme file structure
Publishing the theme
Upgrading a Custom Theme
Editing HTML content
Adding a new page
Adding assets
Adding a component
Customizing a skin
Modifying CSS variables
Editing fonts
Adding JavaScript
uStore library
Working with REST API
Accessing uStore data
Managing custom state
Working with localizations
General services
Adding an external package
Customizing the Theme Editor
Theme tips and tricks
uStoreProvider Reference
Tax Webhook
Order Approval Webhook
Manufacturer Webhook
Widgets
Cart Export Webhook
Input Control Development Guide
Using uStore as a web component