Constructor
new ProductList()
Extends
Members
(static) Enum
Get Enum for product list
children :Array
Array of child components
Type:
- Array
- Overrides:
- Default Value:
- []
- Source:
parent :Component
The parent component
Type:
- Component
- Overrides:
- Default Value:
- null
- Source:
Methods
_callAllBindEvents()
Bind events on the component (include all child-components)
- Overrides:
- Source:
_callAllInit()
Initialize the component (include all child-components)
- Overrides:
- Source:
_callAllRender()
Render the component (include all child-components)
- Overrides:
- Source:
_catchError()
Print error when API return null
_getProductItemClass()
Get Class Object for product display type
_onExtraProductListAjaxSuccess(data, templateName, callback, numberProductPerAjaxCall, ajaxPage, ajaxData, allAjaxData)
Build the extra feature after render product list by by syncing it on our server
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | The filter result data |
templateName |
String | The liquid template of collection product |
callback |
function | The callback function to apply the extra features |
numberProductPerAjaxCall |
Number | The limit product number on calling ajax |
ajaxPage |
Number | The page of calling ajax |
ajaxData |
String | One page of data from collection endpoint. This is the RAW string data |
allAjaxData |
Array | All pages of data from collection endpoint (concated list of ajaxData.products) |
addComponent(childComponent)
Add the child component into a component
Parameters:
Name | Type | Description |
---|---|---|
childComponent |
Object | The child component |
- Overrides:
- Source:
afterBindEvents()
After bind evnets on the component
- Overrides:
- Source:
afterInit()
After initialize callback
- Overrides:
- Source:
afterRender()
After reder component callback
- Overrides:
- Source:
beforeBindEvents()
Before bind events on component callback
- Overrides:
- Source:
beforeInit()
Before initialize callback
- Overrides:
- Source:
beforeRender()
Before reder component callback
- Overrides:
- Source:
bindEvents()
Bind events on the component
- Overrides:
- Source:
buildExtrasProductListByAjax()
Build the extra feature after render product list by calling ajax
buildProductList()
Build the product list
buildProductListDataFromLiquid()
Build the product list from Liquid
getNoResultTemplate()
Get the raw HTML template for filter no result
init()
Initialize component
- Overrides:
- Source:
isBindEvents()
Returns whether or not binding the events on a component
- Overrides:
- Source:
isLoopThroughChild()
Returns whether or not the childs of a component is refresh
- Overrides:
- Source:
isRender() → {Boolean}
Returns whether or not the product list is rendered
- Overrides:
- Source:
Returns:
true OR false from settings
- Type
- Boolean
prepareProductData()
Prepare the product data
refresh()
Refresh component
- Overrides:
- Source:
removeComponent(childComponent)
Remove a child component of a component
Parameters:
Name | Type | Description |
---|---|---|
childComponent |
Object | The child component |
- Overrides:
- Source:
render()
Render the product list
- Overrides:
- Source:
setData(data)
Set data for product list
Parameters:
Name | Type | Description |
---|---|---|
data |
Array | The product list data |