# Function that only one product can be added to the shopping cart

**URL:** <https://forum.adalo.com/t/function-that-only-one-product-can-be-added-to-the-shopping-cart/58195>\
**Category:** Get Help\
**Created:** [August 24, 2025, 11:34am UTC](https://forum.adalo.com/t/function-that-only-one-product-can-be-added-to-the-shopping-cart/58195 "2025-08-24T11:34:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisW](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@chrisW](https://forum.adalo.com/u/chrisW)\
**Post date:** [August 24, 2025, 11:34am UTC](https://forum.adalo.com/t/function-that-only-one-product-can-be-added-to-the-shopping-cart/58195/1 "2025-08-24T11:34:05Z")

</div>

Hello,

I wanted to ask how I can add just one product from a product list to the shopping cart in Adalo, and how the add button disappears if the product is already in the shopping cart. Currently, I don’t know how to set the button’s visibility and filters so that the button is only displayed if no order item has been created for this product. Does anyone have any ideas? 🙂

Best Regards

Christian

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [August 25, 2025, 10:03am UTC](https://forum.adalo.com/t/function-that-only-one-product-can-be-added-to-the-shopping-cart/58195/2 "2025-08-25T10:03:01Z")

</div>

Hi @chrisW,

Welcome to the forum!

You can use “Counts” approach to manage this visibility. Let’s assume you have Products, Carts and Cart Items:

- create a relationship between Products and Cart Items, so that each Cart Item can belong only to one Product. Also you need a relationship Carts - Cart Items (one cart can have many items).
- when you add an item to the cart, you do it with the action Create Cart Item, and you set the relationship to Product and to Cart at this time
- then: on the Product list entry (e.g. Add button), you add a visibility condition, so that Current Cart → Cart Items → Count, where Cart Item → Product → ID is equal to Current Product → ID, is equal to 0.

Please see the screenshot (collection names are different):

 ![Screenshot 2025-08-25 at 14.01.28](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/8/a/8a323c1fe8e56fb0458d8e4aa97777a84113edeb.png)

Best,  
Victor

---

<div class="post-metadata">

**Author:** ![chrisW](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@chrisW](https://forum.adalo.com/u/chrisW)\
**Post date:** [August 28, 2025, 9:15am UTC](https://forum.adalo.com/t/function-that-only-one-product-can-be-added-to-the-shopping-cart/58195/3 "2025-08-28T09:15:58Z")

</div>

Hello Victor,

Great, thank you very much. It worked! 🙂 👍

Best Regards

Christian

---

<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:** [September 7, 2025, 9:16am UTC](https://forum.adalo.com/t/function-that-only-one-product-can-be-added-to-the-shopping-cart/58195/4 "2025-09-07T09:16:38Z")

</div>

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