diff --git a/core/app/models/spree/order_updater.rb b/core/app/models/spree/order_updater.rb index f14178ca254..b40dadad202 100644 --- a/core/app/models/spree/order_updater.rb +++ b/core/app/models/spree/order_updater.rb @@ -15,15 +15,17 @@ def initialize(order) # object with callbacks (otherwise you will end up in an infinite recursion as the # associations try to save and then in turn try to call +update!+ again.) def update - update_item_count - update_totals - if order.completed? - update_payment_state - update_shipments - update_shipment_state + @order.transaction do + update_item_count + update_totals + if order.completed? + update_payment_state + update_shipments + update_shipment_state + end + run_hooks + persist_totals end - run_hooks - persist_totals end def run_hooks