Sha256: 44d51c9762989d9c24118a6e1d31e05b1a93d3f3eb0d4a1d581000a1c3a5c85d

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

#require 'omniauth-identity'

module Locomotive
  module Ecommerce
    class Engine < ::Rails::Engine
      # would this change to Locomotive::Ecommerce?
      isolate_namespace Ecommerce

      def self.config_hash=(hash)
        @config_hash = hash
      end

      def self.config_hash
        @config_hash ||= {}
      end

      def self.config_or_default(key)
        defaults = {
          'cart_url' => '/cart',
          'checkout_url' => '/checkout',
          'post_checkout_url' => '/complete',
          'confirm_order_url' => '/confirm',
          'purchases_url' => '/purchases',
          'estimated_tax_rate' => '15',
          'country_slug' => 'country',
          'province_slug' => 'province',
          'percentage_slug' => 'percentage',
          'shipping_name_slug' => 'name',
          'shipping_over_slug' => 'over',
          'shipping_under_slug' => 'under',
          'price_break' => '100',
          'shop_name' => "<insert name>",
          'shop_inventory' => "inventory_itemsUpdate",
          'contact' => "fake@email.com",
          'require_user' => false
        }
        hash = defaults.merge(config_hash)
        hash[key]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
locomotive_ecommerce_plugin-1.0.6 lib/locomotive/ecommerce/plugin/engine.rb
locomotive_ecommerce_plugin-1.0.5 lib/locomotive/ecommerce/plugin/engine.rb
locomotive_ecommerce_plugin-1.0.4 lib/locomotive/ecommerce/plugin/engine.rb