# Sold quantity control

**URL:** <https://forum.adalo.com/t/sold-quantity-control/44824>\
**Category:** Get Help\
**Created:** [January 23, 2024, 2:15pm UTC](https://forum.adalo.com/t/sold-quantity-control/44824 "2024-01-23T14:15:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luiza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/luiza/32/33013_2.png) [@Luiza](https://forum.adalo.com/u/Luiza)\
**Post date:** [January 23, 2024, 2:15pm UTC](https://forum.adalo.com/t/sold-quantity-control/44824/1 "2024-01-23T14:15:55Z")

</div>

Hello! I’m building my first app and I need a bit of help understanding how to add a function to my app.  
I saw this screenshot that shows exactly what I want to do, which is to show to the clients the total quantity of that product that is still available for purchase, considering how many the clients intend to buy.

 ![Screenshot_2024-01-23-10-55-33-656_com.android.chrome-edit](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/9/8/98f5aa7a4e7bfc188fc283cecf6fa690a20571ec.jpeg)  
This is the screenshot that describes what I want, and I was wondering how to add that to the app.

---

<div class="post-metadata">

**Author:** ![Rozza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/rozza/32/22780_2.png) [@Rozza](https://forum.adalo.com/u/Rozza)\
**Post date:** [January 23, 2024, 2:53pm UTC](https://forum.adalo.com/t/sold-quantity-control/44824/2 "2024-01-23T14:53:43Z")

</div>

Hello 👋

Let’s starting by considering the data structure.  
You probably have a **products** collection, each product has an _availableQty_ field.  
availableQty is updated when an order is placed.

For the shopping cart experience you will need an **orders** collection with a relationship to collection **order\_products** , which has a orderedQty field.

When the checkout is complete update the **product** availableQty = availableQty - orderedQty

Herein lies the problem, doing this as a batch for each product in the order. You need a countdown timer in the list, or a 3rd party making calls to the Adalo API, Make / Zapier / Xano. Read on the forums about pitfalls of countdown timer.

Other problem is possibility for two carts to ‘compete’ for the remaining items, so you must re-check availability prior to check out. For MVP or low volume app, I would not worry about that. For high volume or real world inventory I would use a pre built solution like woo or shopify.

A lot depends on the app you are building and what your needs are

---

<div class="post-metadata">

**Author:** ![Luiza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/luiza/32/33013_2.png) [@Luiza](https://forum.adalo.com/u/Luiza)\
**Post date:** [January 23, 2024, 3:11pm UTC](https://forum.adalo.com/t/sold-quantity-control/44824/3 "2024-01-23T15:11:04Z")

</div>

Thank you so much for answering!  
The problem I’m running into is the part of the availableQty field in the products collection, or how to add that to the product itself, I just can’t figure it out.

---

<div class="post-metadata">

**Author:** ![Rozza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/rozza/32/22780_2.png) [@Rozza](https://forum.adalo.com/u/Rozza)\
**Post date:** [January 23, 2024, 6:16pm UTC](https://forum.adalo.com/t/sold-quantity-control/44824/4 "2024-01-23T18:16:01Z")

</div>

Create a new property? Like this…

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/b/8/b865377afaf1a97d7a42024757f96399a939e971.png)

---

<div class="post-metadata">

**Author:** ![Luiza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/luiza/32/33013_2.png) [@Luiza](https://forum.adalo.com/u/Luiza)\
**Post date:** [January 23, 2024, 9:56pm UTC](https://forum.adalo.com/t/sold-quantity-control/44824/5 "2024-01-23T21:56:52Z")

</div>

Thank you, I feel kind of stupid, but I appreciate the answer, really lol

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [February 2, 2024, 9:57pm UTC](https://forum.adalo.com/t/sold-quantity-control/44824/6 "2024-02-02T21:57:25Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
