Class: CartItem
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- CartItem
- Defined in:
- app/models/cart_item.rb
Instance Method Summary collapse
Instance Method Details
#tax(options = {}) ⇒ Object
12 13 14 15 16 |
# File 'app/models/cart_item.rb', line 12 def tax( = {}) = { :currency => true }.update(.symbolize_keys) ("%01.2f" % (total() - total)).to_f end |
#total(options = {}) ⇒ Object
8 9 10 |
# File 'app/models/cart_item.rb', line 8 def total( = {}) product.price(.update(:voucher_discount => false)) * quantity end |
#weight ⇒ Object
18 19 20 |
# File 'app/models/cart_item.rb', line 18 def weight product.weight * quantity end |