From b1524aa0bdab4d1e2cce5f076a431c3b25a981fc Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 6 Jan 2022 11:21:45 +0100 Subject: [PATCH] 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 --- app/controllers/split_checkout_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/split_checkout_controller.rb b/app/controllers/split_checkout_controller.rb index e37e7ffa6d..1e0461f0cf 100644 --- a/app/controllers/split_checkout_controller.rb +++ b/app/controllers/split_checkout_controller.rb @@ -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