Module: SolidusVolumePricing::Spree::LineItemDecorator

Defined in:
app/decorators/models/solidus_volume_pricing/spree/line_item_decorator.rb

Instance Method Summary collapse

Instance Method Details

#set_pricing_attributesObject



6
7
8
9
10
11
12
13
# File 'app/decorators/models/solidus_volume_pricing/spree/line_item_decorator.rb', line 6

def set_pricing_attributes
  if quantity_changed?
    options = SolidusVolumePricing::PricingOptions.from_line_item(self)
    self.money_price = SolidusVolumePricing::Pricer.new(variant).price_for(options)
  end

  super
end