Remove extra unnecessary :display_on_checkout scope and reuse :frontend scope instead

This commit is contained in:
Cillian O'Ruanaidh
2022-06-08 20:02:43 +01:00
committed by Filipe
parent a5daee39e3
commit 94d71b8dce
2 changed files with 1 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ module EnterprisesHelper
def available_shipping_methods
return [] if current_distributor.blank?
shipping_methods = current_distributor.shipping_methods.display_on_checkout.to_a
shipping_methods = current_distributor.shipping_methods.frontend.to_a
applicator = OpenFoodNetwork::TagRuleApplicator.new(current_distributor,
"FilterShippingMethods", current_customer&.tag_list)

View File

@@ -55,9 +55,6 @@ module Spree
}
scope :by_name, -> { order('spree_shipping_methods.name ASC') }
scope :display_on_checkout, -> {
where("spree_shipping_methods.display_on is null OR spree_shipping_methods.display_on = ''")
}
# Here we allow checkout with shipping methods without zones (see issue #3928 for details)
# and also checkout with addresses outside of the zones of the selected shipping method