From 43869fc140b3adabc03f40209997a413d873170d Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 28 Apr 2020 00:56:18 +0200 Subject: [PATCH] Replace fired events with clearer method call The 'spree.cart.add' event has no listeners in spree_core on in ofn. The 'spree.order.contents_changed' just has a single listener that calls `order.update_distribution_charge`. --- app/controllers/cart_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/cart_controller.rb b/app/controllers/cart_controller.rb index 52c8c3caac..c1a77b433b 100644 --- a/app/controllers/cart_controller.rb +++ b/app/controllers/cart_controller.rb @@ -14,9 +14,7 @@ class CartController < BaseController cart_service = CartService.new(order) if cart_service.populate(params.slice(:products, :variants, :quantity), true) - fire_event('spree.cart.add') - fire_event('spree.order.contents_changed') - + order.update_distribution_charge! order.cap_quantity_at_stock! order.update!