Set the pricing option for catalog products
Last updated: 24-Jun-2019
Use the Product object option property to override the default pricing option defined in your 2Checkout Merchant Control Panel.
TwoCoInlineCart.products.add({code, quantity, options})
method to prepare your catalog product.TwoCoInlineCart.cart.checkout()
method to show the cart on your page.<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",
quantity: 3,
options: [
{
name: '11234',
value: 'new123'
},
{
name: "DEMO_NUMBE_OF_PCS",
value: "premiumversion"
},
{
name: "DEVICES_5",
value: "two_devices"
}
]
});
TwoCoInlineCart.cart.checkout();
});
After overriding the default pricing option using the above method, your cart should look like this: