Module: Shoppe

Defined in:
app/models/shoppe/user.rb,
app/models/shoppe/order.rb,
app/models/shoppe/setting.rb,
app/models/shoppe/address.rb,
app/models/shoppe/payment.rb,
app/models/shoppe/country.rb,
app/models/shoppe/product.rb,
app/models/shoppe/tax_rate.rb,
app/models/shoppe/customer.rb,
app/models/shoppe/order_item.rb,
app/models/shoppe/attachment.rb,
app/models/shoppe/order/states.rb,
app/models/shoppe/order/actions.rb,
app/models/shoppe/order/billing.rb,
app/models/shoppe/order/delivery.rb,
app/models/shoppe/product/variants.rb,
app/models/shoppe/product_category.rb,
app/models/shoppe/delivery_service.rb,
app/models/shoppe/product_attribute.rb,
app/models/shoppe/delivery_service_price.rb,
app/models/shoppe/product_categorization.rb,
app/models/shoppe/stock_level_adjustment.rb,
app/models/shoppe/product/product_attributes.rb,
lib/shoppe.rb

Defined Under Namespace

Classes: Address, Attachment, Country, Customer, DeliveryService, DeliveryServicePrice, Order, OrderItem, Payment, Product, ProductAttribute, ProductCategorization, ProductCategory, Setting, StockLevelAdjustment, TaxRate, User

Class Method Summary collapse

Class Method Details

.add_settings_group(group, fields = []) ⇒ Object

Defines a new set of settings which should be configrable from the settings page in the Shoppe UI.


43
44
45
46
# File 'lib/shoppe.rb', line 43

def add_settings_group(group, fields = [])
  settings_groups[group]  ||= []
  settings_groups[group]    = settings_groups[group] | fields
end

.reset_settingsNilClass

Clears the settings from the thread cache so they will be taken from the database on next access

Returns:

  • (NilClass)

37
38
39
# File 'lib/shoppe.rb', line 37

def reset_settings
  Thread.current[:shoppe_settings] = nil
end

.rootString

The path to the root of the Shoppe applicatinio

Returns:

  • (String)

22
23
24
# File 'lib/shoppe.rb', line 22

def root
  File.expand_path('../../', __FILE__)
end

.settingsShoppe::Settings

Shoppe settings as configured in the database

Returns:

  • (Shoppe::Settings)

29
30
31
# File 'lib/shoppe.rb', line 29

def settings
  Thread.current[:shoppe_settings] ||= Shoppe::Settings.new(Shoppe::Setting.to_hash)
end

.settings_groupsHash

All settings groups which are available for configuration on the settings page.

Returns:

  • (Hash)

51
52
53
# File 'lib/shoppe.rb', line 51

def settings_groups
  @settings_groups ||= {}
end