Sha256: 86ed9e12ac3e69fe5bf20de40074e6c9224358dfd03f00f71278590403bf13a4
Contents?: true
Size: 553 Bytes
Versions: 100
Compression:
Stored size: 553 Bytes
Contents
module Spree module Cart class SetQuantity prepend Spree::ServiceModule::Base def call(order:, line_item:, quantity: nil) ActiveRecord::Base.transaction do run :change_item_quantity run Spree::Dependencies.cart_recalculate_service.constantize end end private def change_item_quantity(order:, line_item:, quantity: nil) return failure(line_item) unless line_item.update(quantity: quantity) success(order: order, line_item: line_item) end end end end
Version data entries
100 entries across 100 versions & 1 rubygems