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.
This commit is contained in:
David Cook
2023-03-17 13:03:41 +11:00
parent ef607da2c1
commit 788457618f

View File

@@ -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