Class: Comable::Customer::Cart

Inherits:
Array
  • Object
show all
Defined in:
app/models/comable/customer.rb

Instance Method Summary collapse

Instance Method Details

#priceObject



61
62
63
64
# File 'app/models/comable/customer.rb', line 61

def price
  cart_item_ids = map(&:id)
  Comable::CartItem.includes(stock: :product).where(id: cart_item_ids).to_a.sum(&:price)
end