mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Check step params and redirect if step is inconsistent to order state
This commit is contained in:
committed by
Maikel Linke
parent
a6e3f43344
commit
77eec6e6f3
@@ -21,6 +21,7 @@ class SplitCheckoutController < ::BaseController
|
||||
|
||||
def edit
|
||||
redirect_to_step_based_on_order unless params[:step]
|
||||
check_step if params[:step]
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -145,4 +146,13 @@ class SplitCheckoutController < ::BaseController
|
||||
end
|
||||
redirect_to_step_based_on_order
|
||||
end
|
||||
|
||||
def check_step
|
||||
case @order.state
|
||||
when "cart", "address", "delivery"
|
||||
redirect_to checkout_step_path(:details) unless params[:step] == "details"
|
||||
when "payment"
|
||||
redirect_to checkout_step_path(:payment) if params[:step] == "summary"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user