On the checkout review page I want to pre-fill the points needed to pay for the order or the available points whichever is the smallest.
I almost have this working in the MultipleStepCheckout template by using the following:
this.viewModel.RewardsPoint = ko.observable((this.viewModel.SalesOrderSet.TotalAmount()) * 100 > this.viewModel.AvailableRewardsPoints() ? this.viewModel.AvailableRewardsPoints() : (this.viewModel.SalesOrderSet.TotalAmount()) * 100)
The problem I am having is that at the time this code executes the shipping charge has not been added to the SalesOrderSet.TotalAmount. So the points value that is calculated is not the correct amount. If I refresh the page then it updates to the correct amunt.
How can I refresh viewModel.RewardsPoint after the Review Order Button is clicked?
Or, is their a better way to do what i want to accomplish.
Thanks