diff --git a/app/helpers/enterprises_helper.rb b/app/helpers/enterprises_helper.rb index 8ca91e2c52b..394f4ae1a07 100644 --- a/app/helpers/enterprises_helper.rb +++ b/app/helpers/enterprises_helper.rb @@ -12,8 +12,6 @@ def current_customer end def available_shipping_methods - return [] if current_distributor.blank? - DistributorShippingMethods.shipping_methods(current_distributor, true, current_customer) end diff --git a/app/services/distributor_shipping_methods.rb b/app/services/distributor_shipping_methods.rb index 914c2678630..36f574f80f4 100644 --- a/app/services/distributor_shipping_methods.rb +++ b/app/services/distributor_shipping_methods.rb @@ -2,6 +2,8 @@ class DistributorShippingMethods def self.shipping_methods(distributor, checkout = false, customer = nil) + return [] if distributor.blank? + methods = if checkout distributor.shipping_methods.display_on_checkout.to_a else