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`.
This commit is contained in:
Matt-Yorkley
2020-04-28 00:56:18 +02:00
parent a5c4364f92
commit 43869fc140

View File

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