Coupons container
The Coupons
container manages the application of coupons to the shopping cart. It provides a text box for users to enter coupon codes. The container uses the applyCouponsToCart
function to apply the coupon to the cart.
Coupons container
Configurations
The Coupons
container provides the following configuration options:
Example configuration
The following example demonstrates how to render the Coupons
container as part of the OrderSummary slot:
{ provider.render(OrderSummary, { routeCheckout: () => '#checkout', slots: { Coupons: (ctx) => { const coupons = document.createElement('div');
provider.render(Coupons)(coupons);
ctx.appendChild(coupons); }, }, showTotalSaved: true, })('.cart__order-summary'),