Guard clause: redirect to /guest when POST

When there is no connected user, and when the distributor doesn't allow guest orders, redirect on POST method
This commit is contained in:
Jean-Baptiste Bellet
2022-01-06 11:21:45 +01:00
parent a36d03a7ab
commit b1524aa0bd

View File

@@ -22,6 +22,8 @@ class SplitCheckoutController < ::BaseController
end
def update
return redirect_to_guest if !spree_current_user && !@order.distributor.allow_guest_orders?
if confirm_order || update_order
clear_invalid_payments
advance_order_state