Class: Spree::Calculator::PercentOnLineItem
Class Method Summary
collapse
Instance Method Summary
collapse
#available?, calculators, #description, register, #to_s
Class Method Details
.description ⇒ Object
6
7
8
|
# File 'app/models/spree/calculator/percent_on_line_item.rb', line 6
def self.description
Spree.t(:percent_per_item)
end
|
Instance Method Details
#compute(object) ⇒ Object
10
11
12
|
# File 'app/models/spree/calculator/percent_on_line_item.rb', line 10
def compute(object)
((object.price * object.quantity) * preferred_percent) / 100
end
|