Merge Cart Behavior | Represents |
---|---|
MERGE | Include both primary and secondary resources, and in case of a conflict, override secondary data with primary data. For example, a coupon can be merged between carts. If one cart has no coupon and the other does, the merged cart will retain the coupon. However, if one cart has a 10% discount and the other has a 20% discount, the merge can’t happen exactly due to conflicting coupon functions. In this case, the 20% discount from the second cart will be discarded, and the merged cart will have the 10% discount. |
ALL | Include both primary and secondary resources together without checking for conflicts. This is mostly applicable for list resources. |
PRIMARY | Only include primary resources. |
SECONDARY | Only include secondary resources. |
PURGE | Remove both primary and secondary resources. |
REFERENCED | Add primary resources and retain only the secondary resources that are referred to in the merged cart. |
Merge Results
Validations merge
- Behavior for line item validation: Inherited from
mergeBehavior.item.behavior
. - Behavior for product catalog validation: Inherited from
mergeBehavior.item.behavior
.
Taxes
Taxes follow the same rules as the parent item. For example, if the item merge rule is set to secondary, the respective taxes are included accordingly. When the item merge rule is set toMERGE
, taxes are cleared, and a state is added to the cart indicating that the item is missing taxes. This adjustment is necessary because changes in quantities may require tax updates.
Item quantity behavior
Item merge behaviors are:- Default (SUM): Quantities of items with the same SKU are summed.
- MAX: The highest quantity of items with the same SKU is selected.