1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(bug) fix cart total error if add a item that have be offered by admin

This commit is contained in:
Du Peng 2022-10-04 12:34:19 +02:00
parent 4f231c0647
commit ccd15d45b2

View File

@ -17,7 +17,7 @@ class Cart::AddItemService
end
raise Cart::OutStockError if item.quantity > orderable.stock['external']
order.total += (item.amount * quantity.to_i)
order.total += (item.amount * item.quantity.to_i) unless item.is_offered
ActiveRecord::Base.transaction do
item.save
order.save