# How would I make a cart system?

**URL:** <https://forum.bubble.io/t/how-would-i-make-a-cart-system/76649>\
**Category:** Need help\
**Created:** [January 19, 2020, 10:16pm UTC](https://forum.bubble.io/t/how-would-i-make-a-cart-system/76649 "2020-01-19T22:16:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![royalmodificaitons](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/royalmodificaitons/32/52123_2.png) [@royalmodificaitons](https://forum.bubble.io/u/royalmodificaitons)\
**Post date:** [January 19, 2020, 10:16pm UTC](https://forum.bubble.io/t/how-would-i-make-a-cart-system/76649/1 "2020-01-19T22:16:52Z")

</div>

Hi, so I am trying to make a cart/shop system, so when a user adds a product to their cart it will show the products they’ve added to that page, and it will also add up all of the prices of the products so it shows a price total of all of the products they have in their cart. how would I make it show the total of all of the prices?

---

<div class="post-metadata">

**Author:** ![royalmodificaitons](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/royalmodificaitons/32/52123_2.png) [@royalmodificaitons](https://forum.bubble.io/u/royalmodificaitons)\
**Post date:** [January 20, 2020, 12:31am UTC](https://forum.bubble.io/t/how-would-i-make-a-cart-system/76649/2 "2020-01-20T00:31:24Z")

</div>

anyone?

---

<div class="post-metadata">

**Author:** ![tctrautman](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/tctrautman/32/52951_2.png) [@tctrautman](https://forum.bubble.io/u/tctrautman)\
**Post date:** [January 20, 2020, 1:01am UTC](https://forum.bubble.io/t/how-would-i-make-a-cart-system/76649/3 "2020-01-20T01:01:52Z")

</div>

This could get complicated quickly, but I’d start out by:

- On a product page, adding a “Add to cart” button that creates a “Product” thing every time the user puts something in their cart. This product should have price, the ID of the user who created it, and true / false field called something like is\_currently\_in\_cart
- In the “Cart” section creating a repeating group (name might be slightly off – I’m still new to Bubble) that shows all products that belong to that user, which also have is\_currently\_in\_cart set to true
- To create the total you would display the sum of all products that belong to that user and have is\_currently\_in\_cart set to true
- Upon purchasing products or removing items from carts, is\_currently\_in\_cart would get set to false

It’s worth noting that this problem gets more complex when you want to allow users to purchase products in quantities greater than 1, or when you want to keep track of inventory and show when products are “unavailable” due to no longer being in stock.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![solinz](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/solinz/32/62584_2.png) [@solinz](https://forum.bubble.io/u/solinz)\
**Post date:** [January 20, 2020, 2:36am UTC](https://forum.bubble.io/t/how-would-i-make-a-cart-system/76649/4 "2020-01-20T02:36:46Z")

</div>

Add to same product thing you have created a price and qty.

In the Repeating group add an input field call it qty. And another input called total cost. Upon checkout clients can type on that qty input how many of that product they want on the total cost you will multiply product price \* qty.  
Now all that has to be stored somewhere as another thing called Orders for example.  
Which you will have Client information, product price product total cost and qty. Maybe order status delivered… in progress… canceled.  
Now go ahead and try. And let us know how it goes… 🙂

---

<div class="post-metadata">

**Author:** ![solinz](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/solinz/32/62584_2.png) [@solinz](https://forum.bubble.io/u/solinz)\
**Post date:** [January 20, 2020, 2:41am UTC](https://forum.bubble.io/t/how-would-i-make-a-cart-system/76649/5 "2020-01-20T02:41:09Z")

</div>

You can use auto bindings (if you want client to edit cart it changes database once you modify input, set state it is temporary memory store values and goes to default if you re load the page, current page user (if you want user which is not registered to add item to cart). You can browse fourm for more information.

---

<div class="post-metadata">

**Author:** ![ericjasonsnell](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@ericjasonsnell](https://forum.bubble.io/u/ericjasonsnell)\
**Post date:** [March 26, 2020, 12:00pm UTC](https://forum.bubble.io/t/how-would-i-make-a-cart-system/76649/6 "2020-03-26T12:00:33Z")

</div>

[royalmodificaitons](https://forum.bubble.io/u/royalmodificaitons) - were you able to do this? I had to create one for a site I’m working on and I’d be happy to share the solution if you need it. It is setup for electronic products and doesn’t do inventory yet. It does have a purchase, cart, and check out process (not very pretty yet, but it works)

---

<div class="post-metadata">

**Author:** ![maxergyinfotech](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@maxergyinfotech](https://forum.bubble.io/u/maxergyinfotech)\
**Post date:** [March 26, 2020, 5:50pm UTC](https://forum.bubble.io/t/how-would-i-make-a-cart-system/76649/7 "2020-03-26T17:50:18Z")

</div>

Hi  
I can help you in this regard. Join me at Skype:- help.paulaustin

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [March 29, 2020, 10:23pm UTC](https://forum.bubble.io/t/how-would-i-make-a-cart-system/76649/8 "2020-03-29T22:23:38Z")

</div>

Closed on March 29, 2020, 10:23pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
