Home > widget-integration > TierDiscountService > addBundleToCart
TierDiscountService.addBundleToCart() method
Adds bundle to Shopify cart. Extension point for custom cart logic.
Signature:
addBundleToCart(model: TierDiscountModel): Promise<void>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
model |
Model containing items to add |
Returns:
Promise<void>
Promise resolving when cart updated
Example
async addBundleToCart(model: TierDiscountModel): Promise<void> {
// Add pre-cart validation
if (!this.validateInventory(model)) {
throw new Error('Insufficient inventory');
}
await super.addBundleToCart(model);
// Track conversion
this.trackBundlePurchase(model);
}