# How to implement the function of changing the number of products in the cart, from the product page?

**URL:** <https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063>\
**Category:** Ask for Help\
**Created:** [December 26, 2022, 9:00pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063 "2022-12-26T21:00:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [December 26, 2022, 9:00pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/1 "2022-12-26T21:00:44Z")

</div>

Hi!  
I have a question. Is it possible to implement using Glide the addition of buttons on the product page that will change its quantity in the cart? (see screenshot)  
I tried to add a button or button bar and select the “Cart” table in the data source, but Glide allows you to select data from the “Products” sheet and User Profile.

 ![photo_2022-12-27_00-01-10](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/c/dc0172cc1bf27124ef3f47fb1105e72c91798c2e.jpeg)

Is there a solution?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 27, 2022, 12:24am UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/2 "2022-12-27T00:24:49Z")

</div>

So are you building your own checkout process or do you use Glide’s native buy button process?

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 6, 2023, 8:35pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/3 "2023-01-06T20:35:45Z")

</div>

I’m creating my own checkout process.  
Now it works like this.  
There is an “Add to cart” button on the product page, which adds a line to the “Cart” sheet and to the “Quantity” column +1.  
Is it possible to change the quantity of the product from the “Products” page?

 ![glide view.PNG](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/1/b1ae229ede9f8ea6acac14323fb65ed8e0f80c41.jpeg)

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 6, 2023, 8:37pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/4 "2023-01-06T20:37:21Z")

</div>

![sheet cart](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/2/6251fc3b63930e3907dca662edfecb09df38d909.png)

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 6, 2023, 8:39pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/5 "2023-01-06T20:39:35Z")

</div>

![sheet products.PNG](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/9/4939b00c30118db6efc150c33457084e4ccef510.jpeg)

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 6, 2023, 8:40pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/6 "2023-01-06T20:40:08Z")

</div>

![Action - Add to cart](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/d/8dd08e04425fe32f96ae8f1fbb87deb2b747286b.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 6, 2023, 11:09pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/7 "2023-01-06T23:09:51Z")

</div>

If you have a single relation from your product table to your cart, then you should be able to add buttons with an action that will increment the number through the relation.

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 7, 2023, 6:13pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/8 "2023-01-07T18:13:50Z")

</div>

Hi!  
Thanks for the advice!  
I created a relation with card table. But Glide does not allow you to place a button on the product page. As soon as I select the “raw - relation cart” button disappears from the screen. (watch the screenshot). It is also not possible to select the required column (quantity) in the “column” section.

 ![Relation cart view.PNG](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/a/0acc32ba10b159255556f731379740e3ff95433d.jpeg)

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 7, 2023, 6:14pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/9 "2023-01-07T18:14:29Z")

</div>

![Relation cart](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/1/31ffd23b4068eaad92a9cea09f379850ca58aba4.png)

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 7, 2023, 6:25pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/10 "2023-01-07T18:25:40Z")

</div>

Please tell me what to do if there are several lines with the same product in the “Cart” sheet? For example, several users added one product. As far as I understand, single relation is not suitable here

---

<div class="post-metadata">

**Author:** ![slscustom.ru](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/slscustom.ru/32/77336_2.png) [@slscustom.ru](https://community.glideapps.com/u/slscustom.ru)\
**Post date:** [January 7, 2023, 6:40pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/11 "2023-01-07T18:40:49Z")

</div>

Добрый вечер! Но Вы же не выбрали столбец, который увеличивать, вот кнопка и не появляется  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/5/1572d3b4140f442a1d78fc89b3f4557e0cae4bda.png)

---

<div class="post-metadata">

**Author:** ![slscustom.ru](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/slscustom.ru/32/77336_2.png) [@slscustom.ru](https://community.glideapps.com/u/slscustom.ru)\
**Post date:** [January 7, 2023, 6:44pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/12 "2023-01-07T18:44:59Z")

</div>

Если корзина заказа это временное место для товаров, то используйте user specific column, чтобы разделить товары разных пользователей.  
Или добавляйте к айди товара - айди пользователя

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 8, 2023, 8:32am UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/13 "2023-01-08T08:32:05Z")

</div>

Здравствуйте! спасибо, за помощь!  
Возможно не корректно выразился на английском. Глайд не давал выбрать колонку, видно глюканул. Я решил сделать через create action и у меня получилось сделать экшн и кнопка не пропала. Однако значение добавляется в корзине в первую найденую строку с товаром, то есть если 3 пользователя добавили одинаковый товар, то любой пользователь который нажмет добавить +1 товар, увеличит его только в первой попавшейся строчке, так как relation single. И я если честно не понимаю, как изменять количества товара в конкретной строке в корзине.

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 8, 2023, 8:41am UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/14 "2023-01-08T08:41:32Z")

</div>

Нет, это не временное место, работает по принципу туда все пользователи добавляют нужный товар, а в табе корзина через фильтр отображается товар который добавлен конкретным зарегистрированным пользователем (email is signed-in user).

“Или добавляйте к айди товара - айди пользователя” - это я добавлю, как по этому управлять incriment number чтобы в нужную строку записать?

---

<div class="post-metadata">

**Author:** ![slscustom.ru](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/slscustom.ru/32/77336_2.png) [@slscustom.ru](https://community.glideapps.com/u/slscustom.ru)\
**Post date:** [January 8, 2023, 1:27pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/15 "2023-01-08T13:27:35Z")

</div>

Добрый день!  
Когда добавляете товар в таблицу корнзина товара, то в столбец itemID пишете айди товара, а в столбец UserID пишете айди пользователя.  
Создатете темплеййт столбец A - ItemID,UserID

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/b/4b05ae4e0526a836953168056fc1faf402871eba.png)

Создаете темплейт с толбец Б - ItemID,"Current user profile row"UserID

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/3/23ff7d3bc2ebf3879404af4023267a49bc1e28cf.png)

Создаете релейшн от Б к А, по этому релейшену делаете инкремент

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/2/02d9cd48f19ffbaadfca82793f78c7638b21d19d.png)

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 8, 2023, 5:51pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/16 "2023-01-08T17:51:28Z")

</div>

Добрый день! Огромное спасибо за то, что помогаете!  
Внимательно прочитал Ваши сообщения, попробовал повторить как у Вас и у меня возникло несколько вопросов:

1. “Создаете релейшн от Б к А, по этому релейшену делаете инкремент” - правильно понял, что задумка такая, чтобы глайд по совместному айди отсекал “чужие” товары? то есть в колонке релейшн должны быть заполнены ячейки только с текущим пользователем? Если да, то тогда релейшн от А к Б должен стоять.
2. Пытаюсь сделать, чтобы можно было управлять количеством товара со страницы товара и для этого как я понимаю, надо сделать релейшн из товаров к корзине. Но я не могу релейшн с релейшеном зацепить.

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 8, 2023, 5:55pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/17 "2023-01-08T17:55:15Z")

</div>

Сейчас у меня это так выглядит. Действительно работает как от текущего пользователя и подсвечивает нужный из одинаковых товаров. Но как это перенести на инкремент на странице товара не могу ума приложить

 ![new relation](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/3/b3e4dfd5d7180265e2f79c88db3d52b1d3c6c666.png)

---

<div class="post-metadata">

**Author:** ![VadikGorky](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vadikgorky/32/52070_2.png) [@VadikGorky](https://community.glideapps.com/u/VadikGorky)\
**Post date:** [January 8, 2023, 7:09pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/18 "2023-01-08T19:09:36Z")

</div>

Кажется у меня получилось через IfElse, БОЛЬШОЕ ВАМ СПАСИБО ЗА ПОМОЩЬ и НАВОДКУ))) Сейчас оформлю пост с решением)

---

<div class="post-metadata">

**Author:** ![slscustom.ru](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/slscustom.ru/32/77336_2.png) [@slscustom.ru](https://community.glideapps.com/u/slscustom.ru)\
**Post date:** [January 8, 2023, 8:54pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/19 "2023-01-08T20:54:14Z")

</div>

> [@VadikGorky](#):
>
> Пытаюсь сделать, чтобы можно было управлять количеством товара со страницы товара и для этого как я понимаю, надо сделать релейшн из товаров к корзине. Но я не могу релейшн с релейшеном зацепить.

Template Б создавайте в таблице товаров, а темплейт А в корзине  
И релейшн от Б из таблицы товаров к А в корзине. Без иф  
В товарах, уВас есть Айди товара, а айди текущего пользователя доступно везде  
Но, конечно же логичнее управлять из корзины, вроде везде так делают

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [January 9, 2023, 8:54pm UTC](https://community.glideapps.com/t/how-to-implement-the-function-of-changing-the-number-of-products-in-the-cart-from-the-product-page/56063/20 "2023-01-09T20:54:30Z")

</div>

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