Add a digital catalog product with auto-applied order promotion
Last updated: 08-Apr-2021
Use the order promotions object to add a digital catalog product with auto-applied order promotion (for PSP business model).
<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>
window.document.getElementById('buy-button').addEventListener('click', function() {
TwoCoInlineCart.products.removeAll();
TwoCoInlineCart.products.add({
code: "STD_SUB",
quantity: 3
});
TwoCoInlineCart.cart.checkout();
});
After adding a digital catalog product with auto-applied order promotion using the above method, your cart should look like this: