I’m starting with Bubble, and i’m trying to build a basic marketplace, i have built the shopping cart linked to a user, the user can view a product and add it to his cart but i really don’t know how to manage the quantity update in the shopping cart, as you can see when i add the same product to my cart, i have twice the same product instead of having it one time with the updated quantity.
I tried to add a condition in the workflow “create new thing” in the shopping cart " only when the product (current page product) in not in the user’s cart" , but i can’t manage to do it properly,
I agree with Tyler. You’re right that a list will only contain unique items, so what your “Cart” data type needs to contain is a list of “Line Items” (or whatever you want to call it), or if you wanted to avoid lists altogether then you could make it so that each “Line Item” has a field for “Cart” to which it belongs.
A “Line Item” could consist of an “Item”, unit price, quantity, subtotal, and so on.
i applied what you said regarding the addition of a “new cart line” when an item is added to the cart and it worked perfectly, thank you very much, i just created the cart right after the user signs up!