Dynamic add to cart feature?

Hello Bubble Forum!

Lately I’ve been trying to do something like the add to cart feature of zeroqode’s eaty template

What I’ve been trying to do:

  • Every time the plus icon is clicked, the cart on the top right will dynamically display the price of the product where the plus icon belongs.
  • The final price displayed on the top right dynamically adjusts whenever the user increases the product quantity by clicking the plus icon. Opposite thing happens with the minus icon

Been spending hours now but still no luck. ATrying to find help here, getting kinda frustrated but ain’t giving up! Hoping for an angel to teach or link me to the guide here that I must’ve missed when I was searching.

I realize that this is asking for a lot but I gotta shoot my shot, hehe

Thanks!

Is your ‘cart’ a database item, or are you trying to create it only on the page somehow?

What is the datasource of your ‘final price’ text element?

The datasource of my “final price” text element is “Currnet User’s cart: each item’s final-price”

Then it should be simple to achieve this…

What’s currently the issue you’re having?

1 Like

I realize that when I get some sleep, I might be able to solve this on my own. But I can’t sleep without solving it first. Jk. I think my problem now is that the plus sign on a product also influences the quantity of other products

Is the Current User's cart a list of things in the medicine-cart data type? If so, are you simply trying to sum the prices of the things in that list in order to show the final price? If that’s the case, can’t you do Current User's cart:each item's final-price:sum?

1 Like

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