Pass quantity to OrderPopulator

This commit is contained in:
Rohan Mitchell
2014-01-08 11:37:38 +11:00
parent 458f91ef91
commit ef56574d82

View File

@@ -5,13 +5,13 @@ Spree::OrdersController.class_eval do
before_filter :update_distribution, :only => :update
before_filter :filter_order_params, :only => :update
# Patch Orders#populate to provide distributor_id and order_cycle_id to OrderPopulator
# Patch Orders#populate to populate multi_cart (if enabled)
def populate
if OpenFoodNetwork::FeatureToggle.enabled? :multi_cart
populate_cart params.slice(:products, :variants, :quantity, :distributor_id, :order_cycle_id)
end
populator = Spree::OrderPopulator.new(current_order(true), current_currency)
if populator.populate(params.slice(:products, :variants))
if populator.populate(params.slice(:products, :variants, :quantity))
fire_event('spree.cart.add')
fire_event('spree.order.contents_changed')
respond_with(@order) do |format|