diff --git a/app/helpers/enterprises_helper.rb b/app/helpers/enterprises_helper.rb index 64d78e7e9381..eaaa4c3e8659 100644 --- a/app/helpers/enterprises_helper.rb +++ b/app/helpers/enterprises_helper.rb @@ -14,7 +14,7 @@ def current_customer def available_shipping_methods return [] if current_distributor.blank? - shipping_methods = current_distributor.shipping_methods + shipping_methods = current_distributor.shipping_methods.display_on_checkout.to_a applicator = OpenFoodNetwork::TagRuleApplicator.new(current_distributor, "FilterShippingMethods", current_customer.andand.tag_list) applicator.filter!(shipping_methods) diff --git a/app/models/spree/shipping_method_decorator.rb b/app/models/spree/shipping_method_decorator.rb index ba7836899d99..e6c22c2dc732 100644 --- a/app/models/spree/shipping_method_decorator.rb +++ b/app/models/spree/shipping_method_decorator.rb @@ -30,6 +30,7 @@ } scope :by_name, -> { order('spree_shipping_methods.name ASC') } + scope :display_on_checkout, -> { where("display_on is null") } # Return the services (pickup, delivery) that different distributors provide, in the format: # {distributor_id => {pickup: true, delivery: false}, ...}