Constructor
new AddToCartRequestListener(request, cart)
Parameters:
| Name | Type | Description |
|---|---|---|
request |
Object | the XMLHttpRequest object |
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
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