The viewModels/SkuPropertiesHandler
module provides access to SKU properties for any widgets that do not have access to the ProductViewModel
. The viewModels/SkuPropertiesHandler
module must be imported by a widget in order for the widget to call its methods, which are described below.
SkuPropertiesHandler.getBase
This method returns property definitions for both custom and out-of-the-box SKU properties created for the Base Product, for example:
viewModels/SkuPropertiesHandler.getBase(targetArray, successCallbackFunction, errorCallbackFunction)
Required arguments include:
targetArray
: An observable array in the UI element that is populated with the properties to be displayed.successCallbackFunction
: (Optional) The function that is called on success.errorCallbackFunction
: (Optional) The function that is called on error.
SkuPropertiesHandler.getCustom
This method returns property definitions for any custom SKU properties created for the specified productType
, for example:
viewModels/SkuPropertiesHandler.getCustom(targetArray, productType, successCallbackFunction, errorCallbackFunction)
If there are no custom SKU properties defined, this method does not populate targetArray
.
Required arguments include:
targetArray
: An observable array in the UI element that is populated with the properties to be displayed.productType
: The name of the product type (for Base Product, this value isproduct
.)successCallbackFunction
: (Optional) The function that is called on success.errorCallbackFunction
: (Optional) The function that is called on error.
SkuPropertiesHandler.getAll
This method returns property definitions for both custom and out-of-the-box SKU properties created for both the Base Product as well as the specified productType
, for example:
viewModels/SkuPropertiesHandler.getAll(targetArray, productType, successCallbackFunction, errorCallbackFunction)
Required arguments include:
targetArray
: An observable array in the UI element that is populated with the properties to be displayed.productType
: The name of the product type (for Base Product, this value isproduct
.)successCallbackFunction
: (Optional) The function that is called on success.errorCallbackFunction
: (Optional) The function that is called on error.