calculate total price

Hello to all.

I have a list of datatypes. And data type includes reference, price, quantity and discount. I want to create a custom action that calculates the total amount whenever an item is added to the list. Currently, I have put a variable named total amount in the page state. I want this variable to be updated by adding each item. But I have no experience. I don't know how to access the application state variable in the custom action. and do other things.

can someone help me

4 replies