Buddi SEO Documentation
Home
Return to Buddi.io
Home
Return to Buddi.io
  • Getting Started

    • Installation Guide
  • Functions

    • Store Selection
    • Single Product
    • All Products
    • Products by Category
    • Products by Categories
    • Featured Promotions
    • Collections
    • Store Info
    • Add to Cart
    • Content Management System
  • Modules

    • Shopping Cart Module
    • Customer Profile
  • Advanced Functions

    • Dynamic object syncing
    • Cart
    • Customer
    • Login Customer
    • Logout Customer
    • Register Customer
    • Update Customer
  • Events
  • FAQ
  • Exceptions Handling
  • Caching
  • Deploying
  • Example Templates

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
}
Last Updated: 10/16/25, 5:57 PM
Contributors: jesseleejohnston
Prev
Store Info
Next
Content Management System