Test adding a product coupon to the InLine Checkout
Last updated: 07-Apr-2021
Use theTwoCoInlineCart.cart.addCoupon('COUPON')
method to apply a single coupon.
TwoCoInlineCart.products.add({code, quantity, options})
method to prepare your catalog product.TwoCoInlineCart.cart.addCoupon('COUPON')
method.TwoCoInlineCart.cart.checkout()
method.<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>
window.document.getElementById('buy-button').addEventListener('click', function() {
TwoCoInlineCart.products.add({
code: "74B8E17CC0"
});
TwoCoInlineCart.cart.addCoupon('CUPON');
TwoCoInlineCart.cart.checkout();
});
After setting the test mode to add a coupon to the InLine checkout using the above method, your cart should look like this: