Model for product list functionality, such as wishlists.
module:models/ProductListModel
The ProductList class
Classes
Methods
(inner) filterOutPrivateLists(listCollection) → {dw.util.Collection}
Takes a list of ProductLists and returns a list of the public ones
Parameters:
Name | Type | Description |
---|---|---|
listCollection |
dw.util.Collection |
a list of ProductLists |
Returns:
publicList - a list of ProductLists that are public
- Type
- dw.util.Collection
(inner) ProductListModel/addProduct(product, quantity, optionModel) → {dw.customer.ProductListItem|null}T
Adds a product to the product list. In case product is already in list null will be returned
Parameters:
Name | Type | Description |
---|---|---|
product |
dw.catalog.Product |
The product to add |
quantity |
Number |
The quantity to add |
optionModel |
dw.catalog.ProductOptionModel |
The option model for the given product |
Returns:
Added item or null
- Type
- dw.customer.ProductListItem | null
(inner) ProductListModel/remove(item)T
Removes the given item from the product list.
Parameters:
Name | Type | Description |
---|---|---|
item |
dw.customer.ProductListItem |
the item to remove |
(inner) ProductListModel/setPublic(isPublic)T
Sets the list to public or private.
Parameters:
Name | Type | Description |
---|---|---|
isPublic |
Boolean |
is the value the public flag is set to. |