diff --git a/app/controllers/cart_controller.rb b/app/controllers/cart_controller.rb index 4be930cc12..658ef2e2f5 100644 --- a/app/controllers/cart_controller.rb +++ b/app/controllers/cart_controller.rb @@ -11,7 +11,7 @@ class CartController < BaseController Spree::Adjustment.without_callbacks do cart_service = CartService.new(order) - cart_service.populate(params.slice(:products, :variants, :quantity), true) + cart_service.populate(params.slice(:variants, :quantity), true) if cart_service.valid? order.update_distribution_charge! order.cap_quantity_at_stock! diff --git a/app/services/cart_service.rb b/app/services/cart_service.rb index cecde9deec..35dcb720f0 100644 --- a/app/services/cart_service.rb +++ b/app/services/cart_service.rb @@ -1,5 +1,7 @@ require 'open_food_network/scope_variant_to_hub' +# Previously Spree::OrderPopulator. Modified to work with max_quantity and variant overrides. + class CartService attr_accessor :order, :currency attr_reader :variants_h