Constructor
new AddToCartFormListener(cart)
Parameters:
| Name | Type | Description |
|---|---|---|
cart |
Object | the CartJS cart object |
- Source:
Extends
Classes
Members
addedItems :Array
Getter that returns an array of items that were added to the cart.
The array is empty if no items were added.
Subclasses can override this method to control the event payload.
Type:
- Array
- Overrides:
- Source:
Methods
getNewQuantities() → {Array.<number>}
Gets the new quantity values for each item on the /cart page.
This is used to determine which items increased in quantity (ie, addedItems)
- Source:
Returns:
the quantity values from the cart form
- Type
- Array.<number>
getQuantityDifference(item) → {number}
Compares the added item against the existing cart and returns the difference in quantity.
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
item |
Object | the item added
Properties
|
- Overrides:
- Source:
Returns:
the quantity increase in the added item
- Type
- number