Class: Spree::WishedItem

Inherits:
Object
  • Object
show all
Extended by:
DisplayMoney
Defined in:
app/models/spree/wished_item.rb

Instance Method Summary collapse

Methods included from DisplayMoney

money_methods

Instance Method Details

#price(currency) ⇒ Object



17
18
19
# File 'app/models/spree/wished_item.rb', line 17

def price(currency)
  variant.amount_in(currency[:currency])
end

#total(currency) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'app/models/spree/wished_item.rb', line 21

def total(currency)
  variant_price = variant.amount_in(currency[:currency])

  if variant_price.nil?
    variant_price
  else
    quantity * variant_price
  end
end