mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-12 03:50:22 +00:00
Perform variant override scoping on product/variant by external class. Centralise this so we can load everything in one go.
This commit is contained in:
@@ -3,8 +3,9 @@ Spree::Core::ControllerHelpers::Order.class_eval do
|
||||
order = current_order_without_scoped_variants(create_order_if_necessary)
|
||||
|
||||
if order
|
||||
scoper = OpenFoodNetwork::ScopeVariantToHub.new(order.distributor)
|
||||
order.line_items.each do |li|
|
||||
li.variant.scope_to_hub order.distributor
|
||||
scoper.scope(li.variant)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user