Why does the app state not update?

I have a checkout page. You can input a discount code. On this page you see the total price ("Totaal"). This is a Custom Function which returns the total price of all the products.

However, if i enter the discount code and click on apply("Toepassen"), it does upgrade the price with the discount amount. But the Custom function which rdisplays the total does not update.

So fore example, the total is 5 Euros. If i apply the discount code DISCOUNT10 and place the order, the total price is updated with the discount amount. So on the backend it works fine, however when i click apply it also needs to update the total price updated with the discount. But it does not do that, what do i do wrong?

This how the Action looks of the Toepassen button:

1 reply