Sha256: 127c73cba795001559bb60176fe89b4d22849266830fb0f81500f7049906f698

Contents?: true

Size: 320 Bytes

Versions: 30

Compression:

Stored size: 320 Bytes

Contents

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

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

  def self.register
    super
    ShippingMethod.register_calculator(self)
  end

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

Version data entries

30 entries across 30 versions & 6 rubygems

Version Path
apispree_core-0.0.0 app/models/calculator/per_item.rb
My-Commerce_core-1.1.0 app/models/calculator/per_item.rb
My-Commerce_core-1.0.0 app/models/calculator/per_item.rb
MyCommerceapi-1.0.0 core/app/models/calculator/per_item.rb
MyCommerce-0.0.3 core/app/models/calculator/per_item.rb
rfcommerce_core-0.0.3 app/models/calculator/per_item.rb
spree_core-0.60.6 app/models/calculator/per_item.rb
spree_core-0.60.5 app/models/calculator/per_item.rb
spree_core-0.30.2 app/models/calculator/per_item.rb
spree_core-0.40.4 app/models/calculator/per_item.rb
spree_core-0.50.4 app/models/calculator/per_item.rb
spree_core-0.60.4 app/models/calculator/per_item.rb
spree_core-0.50.3 app/models/calculator/per_item.rb
spree_core-0.60.3 app/models/calculator/per_item.rb
spree_core-0.60.2 app/models/calculator/per_item.rb
spree_core-0.70.0.rc2 app/models/calculator/per_item.rb
spree_core-0.70.RC1 app/models/calculator/per_item.rb
spree_core-0.60.1 app/models/calculator/per_item.rb
spree_core-0.60.0 app/models/calculator/per_item.rb
spree_core-0.60.0.RC1 app/models/calculator/per_item.rb