Class: Locomotive::Ecommerce::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/locomotive/ecommerce/plugin/engine.rb

Class Method Summary collapse

Class Method Details

.config_hashObject



13
14
15
# File 'lib/locomotive/ecommerce/plugin/engine.rb', line 13

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

.config_hash=(hash) ⇒ Object



9
10
11
# File 'lib/locomotive/ecommerce/plugin/engine.rb', line 9

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

.config_or_default(key) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/locomotive/ecommerce/plugin/engine.rb', line 17

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' => "[email protected]",
    'require_user' => false
  }
  hash = defaults.merge(config_hash)
  hash[key]
end