Sha256: a9c366a0167c08fe43eb1f558593e0dc918d71549e2afcf99e82f6daa61cd45b

Contents?: true

Size: 272 Bytes

Versions: 8

Compression:

Stored size: 272 Bytes

Contents

module Spree
  class Calculator::PerItem < Calculator
    preference :amount, :decimal, :default => 0

    def self.description
      I18n.t(:flat_rate_per_item)
    end

    def compute(object=nil)
      self.preferred_amount * object.line_items.length
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spree_core-1.0.3 app/models/spree/calculator/per_item.rb
spree_core-1.0.2 app/models/spree/calculator/per_item.rb
spree_core-1.0.1 app/models/spree/calculator/per_item.rb
spree_core-1.0.0 app/models/spree/calculator/per_item.rb
spree_core-1.0.0.rc4 app/models/spree/calculator/per_item.rb
spree_core-1.0.0.rc3 app/models/spree/calculator/per_item.rb
spree_core-1.0.0.rc2 app/models/spree/calculator/per_item.rb
spree_core-1.0.0.rc1 app/models/spree/calculator/per_item.rb