diff options
author | Brendan Deere <brendan@stembolt.com> | 2016-09-28 13:56:21 -0700 |
---|---|---|
committer | Brendan Deere <brendan@stembolt.com> | 2016-09-28 14:31:28 -0700 |
commit | 41885d548ad9870fd2272543c09241f81cc92d2b (patch) | |
tree | 00886dc57ba70a1fb24852cd5d8fa970031b85aa /lib/solidus_subscriptions/engine.rb | |
parent | 7414d6856d4f746ca7000985860e415385edef31 (diff) |
Register Subscription promotion rule with solidus
Add the custom promotion rule to the list of solidus promotion rules.
add some translations and an empty template so that the admin can render
the promotion rule properly
Diffstat (limited to 'lib/solidus_subscriptions/engine.rb')
-rw-r--r-- | lib/solidus_subscriptions/engine.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/solidus_subscriptions/engine.rb b/lib/solidus_subscriptions/engine.rb index 50b1dc1..78f0d47 100644 --- a/lib/solidus_subscriptions/engine.rb +++ b/lib/solidus_subscriptions/engine.rb @@ -15,6 +15,10 @@ module SolidusSubscriptions require 'solidus_subscriptions/config' end + initializer 'register_subscription_promotion_rule', after: 'spree.promo.register.promotion.rules' do |app| + app.config.spree.promotions.rules << 'SolidusSubscriptions::SubscriptionPromotionRule' + end + def self.activate Dir.glob(File.join(File.dirname(__FILE__), '../../app/decorators/**/*.rb')) do |c| Rails.configuration.cache_classes ? require(c) : load(c) |