Skip to main content

I made variables for the quantities of these three items (it’s the same variable) so that it reflects the cart icon. The tutorials I watched only show how to do it to one item, not more than one. Let’s say I want 1 pork, 3 chicken, and 5 beef. My cart icon isn’t able to add them all up to total 9. Any suggestions?



I have two more just like this but with two different meats (Figma won’t let me post more than one photo)

You can check my response here

In short you need following variables:

m1,m2,m3,m4,m5 (for the meats) = 0

pm1,pm2,pm3,pm4,pm5 (for the price of each meat) = (values in $)

Qty(for the quantity) = 0

Amount(for total price) = 0


So, now when you select each meat there will be a single Quantity picker(counter) that will reset to 0 on each meat selection.

Step 1: Select Meat

Step 2: Counter resets to 0

Step 3: Set the Quantity

Step 4: Press ‘Add’ (or whatever name you have)

Step 5:

Set mx = mx + Qty Qty is Counter value, x is selected meat 1-5]

Amount = amount + (mx * pmx) pmx is selected meat price]

Step 6: repeat.


Thank you so much for your helpful response! I think I have it figured out, except the last step. I have m1 (pork), m1 (beef), and m3 (chicken) and each variable is set to 0 (and corresponds to their own counters (the “0”). Is the last step creating an interaction so that my cart icon can total up the quantities of all three meats?


I took a single quantity counter variable. I guess you have 3 variable for each meat counter.


So when you hit the Add button, you should set Qty = qm1 + qm2 + qm3 (individual quantity counters)


Amount just adds up the prices for selected items. You can ignore if you are not using prices.


And yes, after pressing add, reset all variables except Qty and Amount to 0 if you wanna repeat the steps. Else, you can proceed with the flow. If you wanna add more, you’ll have to store the Qty and Amount.


Reply