Skip to content

Commit

Permalink
Make ship method display on back_end work correcly by making checkout…
Browse files Browse the repository at this point in the history
… ignore ship methods configured for backoffice only
  • Loading branch information
luisramos0 committed May 8, 2020
1 parent 02b38b1 commit ee9b3c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/enterprises_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/models/spree/shipping_method_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}, ...}
Expand Down

0 comments on commit ee9b3c3

Please sign in to comment.