Sha256: c08f289547e7940f26fe2e97a0313513b861d3f477a46945f6ea99a4954ed640

Contents?: true

Size: 349 Bytes

Versions: 5

Compression:

Stored size: 349 Bytes

Contents

# A rule to limit a promotion to a specific user.
class Promotion::Rules::ItemTotal < PromotionRule

  preference :amount, :decimal, :default => 100.00
  preference :operator, :string, :default => '>'

  OPERATORS = ['gt', 'gte']

  def eligible?(order)
    order.item_total.send(preferred_operator == 'gte' ? :>= : :>, preferred_amount)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_promo-0.40.4 app/models/promotion/rules/item_total.rb
spree_promo-0.40.3 app/models/promotion/rules/item_total.rb
spree_promo-0.40.2 app/models/promotion/rules/item_total.rb
spree_promo-0.40.1 app/models/promotion/rules/item_total.rb
spree_promo-0.40.0 app/models/promotion/rules/item_total.rb