Acceptable values for the imports property
When defining a widget, one of the properties you may choose to set in the
widget.json
file is the imports property.
By default, widgets have access to data and functions contained in the common view models (user, cart, site and so on). However, in order for a widget to have access to page-specific view models, those view models must be explicitly defined in the imports property. The possible values that are acceptable for the imports property depends on the type of page the widget will be placed on. To determine which page-specific view models your widget can have access to, determine the page type the widget will be placed on and then review the acceptable values for that page type in the following sections.
Note that some page types have no page-specific view models. These include home, order history, article, error, shopper wish list profile, search results, and no search results.
Category
Acceptable imports values include the following:
category
categoryId
dimensionId
productTypes
Product
Acceptable imports values include the following:
product
productTypes
productVariantOptions
Cart
Acceptable imports values include the following:
defaultShippingCountry
order
payment
shippingCountries
shippingCountriesPriceListGroup
shippingmethods
Checkout
Acceptable imports values include the following:
billingCountries
defaultBillingCountry
defaultShippingCountry
order
payment
paymentauthorization
shippingCountries
shippingCountriesPriceListGroup
shippingmethods
Confirmation
Acceptable imports values include the following:
confirmation
defaultShippingCountry
shippingCountries
shippingCountriesPriceListGroup
Order Details
Acceptable imports values include the following:
defaultShippingCountry
orderDetails
shippingCountries
shippingCountriesPriceListGroup
Shopper Profile
Acceptable imports values include the following:
defaultShippingCountry
shippingCountries
shippingCountriesPriceListGroup
Wish List
Acceptable imports values include the following:
space