Update order state when moving back through checkout step

Some important logic happens after the order transition from one state
to another. In particular, voucher are recalculated. To fix any
inconsistency, we make sure the order is the state matching the checkout
step we are on.
This commit is contained in:
Gaetan Craig-Riou
2023-10-18 09:45:05 +11:00
parent d0e38c8d10
commit b09054a76a
3 changed files with 54 additions and 2 deletions

View File

@@ -24,6 +24,8 @@ class SplitCheckoutController < ::BaseController
def edit
redirect_to_step_based_on_order unless params[:step]
update_order_state if params[:step]
check_step if params[:step]
return if available_shipping_methods.any?