Remove from basket and change variable

Hi,
I have repeater in my basket which shows all added items. Every row has “x” buttom to remove item from basket.
When I remove item from basket the TOTAL sum must be actualized to sum without this item.

Intercation on clik I added inverse what I have when I add to basket: [[(TotalPrice-Item.Price).tofixed(2)]], also tried “[[TotalPrice-Intem.Price]]” and it doesn’t works.

Maybe some idea how to actualized sum?

Can’t you just subtract the value from the widget displaying the total using the value of the relevant field in the row that’s being deleted when the “x” button is clicked?

I assume you are increasing the total displayed by that widget when you add items, after all.

I don’t know if I correctly understand you, but I have my basket in repeater and the item’s price is in column Item.Price and widget dispalying sum has value TotalPrice. I was substarting something like this: TotalPrice-Item.Price but it doesn’t work. Maybe do you mean to substract from the names from widgets?

Widget which display my sum is name “TOTAL” and the item’s price “PRICE”. I am not sure what to do because I think I don’t know which interaction use

Can you upload an RP file with that you are doing at the moment?

newbasket.rp (10.0 MB)

I upload a rp file, but it isn’t in english language but variables are in english. You need to add items to the basket on the right and from this I want to remove them. On the left of the egreen button is total price.

Nevermind. I am trying again with another variable and now it works :slight_smile:

Hi, Sylwia.
Can you please share your solution? it seems I have the same problem

I have 2 variables:
“NumberOfProducts” which saves values of number of added thins and “Total Price” which contains a sum of all items.
I did interaction On Click on “x” and when i remove an item so i reduce item by one so i do : set variable value> target: NumberOfProducts > seto to : value> [[NumberOfProducts-1]] and second Set Text to> value of variable> and place when my number is changing.
I also did the same with Total: set variable value>set to value: [[ (TotalPrice -Item.price ).tofixed(2) ]] , where my Item.price is from column in my basket repeater and set text> where you have the sum.
On last I add : Delate rows from my basket repeater

Thanks, I fixed it!
Actually I have the similar logic, and as it turned out, the thing was in order of actions at the Onclick event.

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