Sha256: 1ca364b973ff1779a9feff0ef5b59306da6af3d1ebd60002176cdf4250511395

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 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::Product
    ShopOrder.send    :include, ShopDiscounts::Models::Discountable
    ShopCategory.send :include, ShopDiscounts::Models::Discountable
    
    Page.send :include, ShopDiscounts::Tags::Cart, ShopDiscounts::Tags::Item
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
radiant-shop_discounts-extension-0.0.3 shop_discounts_extension.rb