Forum Academy Marketplace Showcase Pricing Features

How to create a feature to add multiple items to cart?

Hey Bubblers,

I need help with building a feature that will allow user to add multiple items to car. I have a basic add to cart function built but I want to allow the user to be able to see how many items he/she has added and allow multiple items to be added to a cart.

Thank you in advance

Basically you would add a field to the User data type called “Cart (list of items/products)”.

Every time they want to add an item = add that item to their Cart
Every time they want to remove an item = remove that item from their Cart

If you want to add quantity, you would create a new data type called “CartItem” that would have the item and quantity (number).

We have a tutorial for this: Build a Shopping Cart