From 788457618fdb628f608b73a441a42e8b36195407 Mon Sep 17 00:00:00 2001 From: David Cook Date: Fri, 17 Mar 2023 13:03:41 +1100 Subject: [PATCH] Check ship address required based on all available methods This check was implemented based on 'allowed' shipping methods, but we need to revert that logic. So for now, we can check all 'available' shipping methods. This could potentially result in the same query being run twice, because load_shipping_methods also loads it. I opted to keep things simple and not try to optimise here. --- app/controllers/split_checkout_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/split_checkout_controller.rb b/app/controllers/split_checkout_controller.rb index 3d8a708fc9..e33bd0038b 100644 --- a/app/controllers/split_checkout_controller.rb +++ b/app/controllers/split_checkout_controller.rb @@ -168,7 +168,7 @@ class SplitCheckoutController < ::BaseController end def shipping_method_ship_address_not_required? - selected_shipping_method = allowed_shipping_methods&.select do |sm| + selected_shipping_method = available_shipping_methods&.select do |sm| sm.id.to_s == params[:shipping_method_id] end