Module: Shoppe

Defined in:
lib/shoppe.rb,
lib/shoppe/error.rb,
lib/shoppe/engine.rb,
lib/shoppe/version.rb,
lib/shoppe/settings.rb,
app/models/shoppe/user.rb,
app/models/shoppe/order.rb,
lib/shoppe/view_helpers.rb,
app/models/shoppe/address.rb,
app/models/shoppe/country.rb,
app/models/shoppe/payment.rb,
app/models/shoppe/product.rb,
app/models/shoppe/setting.rb,
lib/shoppe/orderable_item.rb,
app/models/shoppe/customer.rb,
app/models/shoppe/tax_rate.rb,
lib/shoppe/model_extension.rb,
lib/shoppe/settings_loader.rb,
lib/shoppe/setup_generator.rb,
lib/shoppe/country_importer.rb,
app/models/shoppe/attachment.rb,
app/models/shoppe/order_item.rb,
lib/shoppe/navigation_manager.rb,
app/mailers/shoppe/user_mailer.rb,
app/models/shoppe/order/states.rb,
app/mailers/shoppe/order_mailer.rb,
app/models/shoppe/order/actions.rb,
app/models/shoppe/order/billing.rb,
lib/shoppe/associated_countries.rb,
lib/shoppe/errors/refund_failed.rb,
app/models/shoppe/order/delivery.rb,
app/models/shoppe/delivery_service.rb,
app/models/shoppe/product/variants.rb,
app/models/shoppe/product_category.rb,
lib/shoppe/errors/not_enough_stock.rb,
lib/shoppe/errors/payment_declined.rb,
lib/shoppe/errors/unorderable_item.rb,
app/models/shoppe/product_attribute.rb,
app/helpers/shoppe/application_helper.rb,
app/controllers/shoppe/users_controller.rb,
lib/shoppe/errors/invalid_configuration.rb,
app/controllers/shoppe/orders_controller.rb,
app/models/shoppe/delivery_service_price.rb,
app/models/shoppe/product_categorization.rb,
app/models/shoppe/stock_level_adjustment.rb,
app/controllers/shoppe/payments_controller.rb,
app/controllers/shoppe/products_controller.rb,
app/controllers/shoppe/sessions_controller.rb,
app/controllers/shoppe/settings_controller.rb,
app/controllers/shoppe/variants_controller.rb,
app/helpers/shoppe/product_category_helper.rb,
app/controllers/shoppe/addresses_controller.rb,
app/controllers/shoppe/countries_controller.rb,
app/controllers/shoppe/customers_controller.rb,
app/controllers/shoppe/dashboard_controller.rb,
app/controllers/shoppe/tax_rates_controller.rb,
app/models/shoppe/product/product_attributes.rb,
app/controllers/shoppe/application_controller.rb,
app/controllers/shoppe/attachments_controller.rb,
lib/shoppe/errors/insufficient_stock_to_fulfil.rb,
lib/shoppe/errors/inappropriate_delivery_service.rb,
app/controllers/shoppe/delivery_services_controller.rb,
app/controllers/shoppe/product_categories_controller.rb,
app/controllers/shoppe/product_localisations_controller.rb,
app/controllers/shoppe/delivery_service_prices_controller.rb,
app/controllers/shoppe/stock_level_adjustments_controller.rb,
app/controllers/shoppe/product_category_localisations_controller.rb

Defined Under Namespace

Modules: ApplicationHelper, AssociatedCountries, CountryImporter, Errors, ModelExtension, OrderableItem, ProductCategoryHelper, ViewHelpers Classes: Address, AddressesController, ApplicationController, Attachment, AttachmentUploader, AttachmentsController, CountriesController, Country, Customer, CustomersController, DashboardController, DeliveryService, DeliveryServicePrice, DeliveryServicePricesController, DeliveryServicesController, Engine, Error, NavigationManager, Order, OrderItem, OrderMailer, OrdersController, Payment, PaymentsController, Product, ProductAttribute, ProductCategoriesController, ProductCategorization, ProductCategory, ProductCategoryLocalisationsController, ProductLocalisationsController, ProductsController, SessionsController, Setting, Settings, SettingsController, SettingsLoader, SetupGenerator, StockLevelAdjustment, StockLevelAdjustmentsController, TaxRate, TaxRatesController, User, UserMailer, UsersController, VariantsController

Constant Summary collapse

VERSION =
"1.1.2"

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 application

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:



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