Sha256: 9961b9d7ef90bf6d511c8ae0b0eceaefc3b847fd07733526a7d08f6693f98a3d

Contents?: true

Size: 586 Bytes

Versions: 78

Compression:

Stored size: 586 Bytes

Contents

module Spree
  module Cart
    class RemoveLineItem
      prepend Spree::ServiceModule::Base

      def call(order:, line_item:, options: nil)
        options ||= {}
        ActiveRecord::Base.transaction do
          line_item.destroy!
          Spree::Dependencies.cart_recalculate_service.constantize.new.call(order: order,
                                                                            line_item: line_item,
                                                                            options: options)
        end
        success(line_item)
      end
    end
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
spree_core-4.0.9 app/services/spree/cart/remove_line_item.rb
spree_core-4.1.15 app/services/spree/cart/remove_line_item.rb
spree_core-4.2.7 app/services/spree/cart/remove_line_item.rb
spree_core-4.3.3 app/services/spree/cart/remove_line_item.rb
spree_core-4.4.1 app/services/spree/cart/remove_line_item.rb
spree_core-4.2.6 app/services/spree/cart/remove_line_item.rb
spree_core-4.3.2 app/services/spree/cart/remove_line_item.rb
spree_core-4.4.0 app/services/spree/cart/remove_line_item.rb
spree_core-4.4.0.rc2 app/services/spree/cart/remove_line_item.rb
spree_core-4.3.1 app/services/spree/cart/remove_line_item.rb
spree_core-4.4.0.rc1 app/services/spree/cart/remove_line_item.rb
spree_core-4.3.0 app/services/spree/cart/remove_line_item.rb
spree_core-4.3.0.rc3 app/services/spree/cart/remove_line_item.rb
spree_core-4.3.0.rc2 app/services/spree/cart/remove_line_item.rb
spree_core-4.3.0.rc1 app/services/spree/cart/remove_line_item.rb
spree_core-4.2.5 app/services/spree/cart/remove_line_item.rb
spree_core-4.1.14 app/services/spree/cart/remove_line_item.rb
spree_core-4.0.8 app/services/spree/cart/remove_line_item.rb
spree_core-4.2.4 app/services/spree/cart/remove_line_item.rb
spree_core-3.7.14.1 app/services/spree/cart/remove_line_item.rb