If customers can select multiple products before reaching your checkout page, you need to setup dyanamic shopping.

Modifying Cart Items

Modifying Cart Items with LeanTags

product_quantity LeanTag for single product in page

<input type=”number” data-lp-type=”product_quantity”/>

product_quantity LeanTag for multiple products in page

<input type=”number” data-lp-type=”product_quantity” data-lp-product=”1”/>

* the product id can be retrieved from the edit product page in the platform

Modifying Cart Items with Javascript

window.lpCart.set_cart_items(cart_items) cart_items = [{ product_id: #, quantity: #},...]
window.lpCart.get_cart_items(callback) function(cart_items){}
window.lpCart.get_total_price(callback) callback(price_object) price_object = {"total_price": items_price + tax + shipping + handling - discount, "items_price": items_price, "shipping": shipping, "tax": tax, "currency": currency, "handling": handling, "discount":discount}
window.lpCart.get_available_products(callback) function(products){}

Examples

Add product with id 1 and continue to checkout window.lpCart.set_cart_items([ { product_id: window.lpSettings.cart.products[0].id, quantity: 1, }, ]); window.location = "./checkout.html";
Add the product define in the page to cart and continue to checkout window.lpCart.get_available_products(function(products){ window.lpCart.set_cart_items([ { product_id:products[0].id, quantity: 1, }, ]); window.location = "./checkout.html"; });
Change cart Item Quantity - JS window.lpCart.get_cart_items(function(cart_items){ var modified_cart_items = cart_items; //modify the cart items ... window.lpCart.set_cart_items(modified_cart_items); })