# Update product stock on a loop

**URL:** <https://community.weweb.io/t/update-product-stock-on-a-loop/17687>\
**Category:** Ask us anything\
**Tags:** supabase\
**Created:** [April 8, 2025, 10:12pm UTC](https://community.weweb.io/t/update-product-stock-on-a-loop/17687 "2025-04-08T22:12:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurentvienne](https://avatars.discourse-cdn.com/v4/letter/l/85e7bf/32.png) [@laurentvienne](https://community.weweb.io/u/laurentvienne)\
**Post date:** [April 8, 2025, 10:12pm UTC](https://community.weweb.io/t/update-product-stock-on-a-loop/17687/1 "2025-04-08T22:12:35Z")

</div>

Hi I try, to update the stock in a cart from a loop. but it replace the value instead of calculating the stock - the qty of the cart. How can I pull the stock of the product in the update ?

 ![Screenshot 2025-04-09 at 10.11.08 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/f/faf8870cabb4ff604622cde58ebddf26cf73609c.png)
