Sha256: c408f4bfe0ee2f830df288732b4c1686a717f5cd07305c656377c71a31ce9e7f

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

class ShopDiscountsExtension < Radiant::Extension
  version YAML::load_file(File.join(File.dirname(__FILE__), 'VERSION'))
  description "Add Discounts to Radiant Shop"
  url "https://github.com/thefrontiergroup/radiant-shop_discounts-extension"
  
  extension_config do |config|
    config.gem 'radiant-shop-extension'
  end
  
  UserActionObserver.instance.send :add_observer!, ShopDiscount
  UserActionObserver.instance.send :add_observer!, ShopDiscountable
  
  def activate
    
    tab "Shop" do
      add_item "Discounts", "/admin/shop/discounts", :before => "Orders"
    end
    
    ShopLineItem.send :include, ShopDiscounts::Models::Discountable, ShopDiscounts::Models::Purchaseable
    
    ShopProduct.send  :include, ShopDiscounts::Models::Discountable, ShopDiscounts::Models::ShopProduct
    ShopOrder.send    :include, ShopDiscounts::Models::Discountable, ShopDiscounts::Models::ShopOrder
    ShopCategory.send :include, ShopDiscounts::Models::Discountable
    User.send         :include, ShopDiscounts::Models::Discountable
    
    Page.send         :include, ShopDiscounts::Tags::Cart, ShopDiscounts::Tags::Item
    
    FormLineItem.send :include, ShopDiscounts::Models::FormLineItem
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
radiant-shop_discounts-extension-0.0.8 shop_discounts_extension.rb
radiant-shop_discounts-extension-0.0.7 shop_discounts_extension.rb
radiant-shop_discounts-extension-0.0.6 shop_discounts_extension.rb
radiant-shop_discounts-extension-0.0.4 shop_discounts_extension.rb