Add to Cart
This method is used to allow items to be added to the customers shopping cart.
addToCart
The method adds qty units of the product option with the given ri_id to the cart.
Params:
ri_id - Retailer inventory ID. You can get it from the getProduct or getProducts methods. You can find this value in product.options[*].ri_id
Example:
Buddi.addToCart({qty: 1, ri_id: 123});
Events: cart:product-added, cart:product-adding-error, cart:updated
Returns:
{
id: "ydebrldim3hmbyq1o3xdrsuwz3xvrjsy",
is_available_for_purchase: true,
options: {...},
price: 40,
product: {...},
product_id: 748530,
product_size_id: 172677,
qty: 1,
ri_id: 432917,
stock_qty: 1,
subtotal: 40
}