Method: Spree::Variant#price_difference_from_master
- Defined in:
- app/models/spree/variant.rb
#price_difference_from_master(pricing_options = Spree::Config.default_pricing_options) ⇒ Object
Returns the difference in price from the master variant
301 302 303 304 305 306 |
# File 'app/models/spree/variant.rb', line 301 def price_difference_from_master( = Spree::Config.) master_price = product.master.price_for() variant_price = price_for() return unless master_price && variant_price variant_price - master_price end |