Sha256: 1546907c2cb3d60a4b7e5f1ad1af4421f32f11ad23d8336aca78586f5d88c9d6
Contents?: true
Size: 479 Bytes
Versions: 23
Compression:
Stored size: 479 Bytes
Contents
require_dependency 'spree/calculator' module Spree class Calculator::FlatRate < Calculator preference :amount, :decimal, default: 0 preference :currency, :string, default: -> { Spree::Store.default.default_currency } def self.description Spree.t(:flat_rate_per_order) end def compute(object = nil) if object && preferred_currency.casecmp(object.currency.upcase).zero? preferred_amount else 0 end end end end
Version data entries
23 entries across 23 versions & 1 rubygems