mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
Scope variant only when inventory is enabled
This wasn't pick up our specs, so I am not actually sure it's usefull.Still for consistency sake we don't want to scope if inventory is disabled
This commit is contained in:
@@ -20,7 +20,11 @@ module Spree
|
||||
if order&.line_items.present?
|
||||
scoper = OpenFoodNetwork::ScopeVariantToHub.new(order.distributor)
|
||||
order.line_items.each do |li|
|
||||
scoper.scope(li.variant)
|
||||
scoper.scope(
|
||||
li.variant,
|
||||
inventory_enabled: OpenFoodNetwork::FeatureToggle.enabled?(:inventory,
|
||||
order.distributor)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user