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:
Gaetan Craig-Riou
2025-07-03 14:42:24 +10:00
parent 6937a133ae
commit 681eee9309

View File

@@ -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