Module: Spree::LineItemDecorator

Includes:
VatPriceCalculation
Defined in:
app/models/spree/line_item_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



2
3
4
# File 'app/models/spree/line_item_decorator.rb', line 2

def self.prepended(base)
	base.belongs_to :group_buy, class_name: 'Spree::GroupBuy'
end

Instance Method Details

#update_priceObject



8
9
10
11
12
13
14
# File 'app/models/spree/line_item_decorator.rb', line 8

def update_price
  if group_buy_id?
  	self.price = gross_amount(group_buy.price, {tax_zone: tax_zone, tax_category: variant.tax_category})
  else
 self.price = variant.price_including_vat_for(tax_zone: tax_zone)
	  end
end