TheShop
  • Home
    • TheShop: Headless e-commerce platform with API-first approach
  • GETTING STARTED
    • Quickstart guide
  • frontstore
    • Introduction
      • Types of frontstores
    • API
      • Frontstore API
      • Template customization
    • API client for Laravel
      • Example: Find products by keyword and include sold out products with available attributes to filter
    • Basic selling flow
      • Homepage
      • Product list
      • Product detail
        • Availability and count info in products
        • Add products to cart
        • Variants tree
      • Shopping cart (Basket)
        • Shopping cart list
        • Voucher (discount code)
      • Shipping and payment
      • Checkout
        • Completing order – payment flow
    • Contact form
    • Headless CMS
    • Caching
    • Known Issues
    • FAQ
Powered by GitBook
On this page
  • Types of products in the shopping cart
  • Simple product
  • Product variant
  • Multipack product
  1. frontstore
  2. Basic selling flow
  3. Product detail

Add products to cart

PreviousAvailability and count info in productsNextVariants tree

Last updated 2 years ago

Add to cart functionality is a fundamental feature that allows customers to add a particular product to their Shopping cart.

When adding product to the shopping cart, always check if the selected product is available.

checks if product is available.

Types of products in the shopping cart

There are three types of products that can be added to the Shopping cart. You can combine all of them within the one cart call.

Simple product

When adding a simple product, you should use cart[] array in endpoint to get correct results from the shopping cart.

Product variant

When adding a variant of product to the shopping cart, use variants[] array in endpoint to get correct results from the shopping cart.

Multipack product

If adding a multipack product, use multipack[] array in endpoint to get correct results from the shopping cart.

This API call
Add to cart button located in the right side of the screen