mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-01 21:47:16 +00:00
Add feature toggle for filtering shipping methods
This commit is contained in:
@@ -20,6 +20,9 @@ class OrderAvailableShippingMethods
|
||||
private
|
||||
|
||||
def filter_by_category(methods)
|
||||
return methods unless OpenFoodNetwork::FeatureToggle.enabled?(:match_shipping_categories,
|
||||
distributor&.owner)
|
||||
|
||||
required_category_ids = order.products.pluck(:shipping_category_id).to_set
|
||||
return methods if required_category_ids.empty?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user