Class: Spree::AppConfiguration
- Inherits:
-
Preferences::Configuration
- Object
- Preferences::Configuration
- Spree::AppConfiguration
- Includes:
- Core::EnvironmentExtension
- Defined in:
- lib/spree/app_configuration.rb
Instance Attribute Summary collapse
-
#add_payment_sources_to_wallet_class ⇒ Class
Allows providing your own class for adding payment sources to a user’s “wallet” after an order moves to the complete state.
-
#address_requires_phone ⇒ Boolean
Should phone number be required (default:
true). -
#address_requires_state ⇒ Boolean
Should state/state_name be required (default:
true). -
#admin_interface_logo ⇒ String
URL of logo used in admin (default: ‘logo/solidus.svg’).
-
#admin_products_per_page ⇒ Integer
Number of products to display in admin (default:
10). -
#admin_variants_per_page ⇒ Integer
Number of variants to display in admin (default:
20). -
#admin_vat_country_iso ⇒ String?
Set this if you want to enter prices in the backend including value added tax.
-
#allow_checkout_on_gateway_error ⇒ Boolean
Allow checkout to complete after a failed payment (default:
false). -
#allow_guest_checkout ⇒ Boolean
When false, customers must create an account to complete an order (default:
true). -
#allow_return_item_amount_editing ⇒ Boolean
Determines whether an admin is allowed to change a return item’s pre-calculated amount (default:
false). -
#allowed_image_mime_types ⇒ Array
Defines which MIME types are allowed for images ‘%w(image/jpeg image/jpg image/png image/gif).freeze` is the default.
-
#alternative_billing_phone ⇒ Boolean
Request an extra phone number for bill address (default:
false). -
#alternative_shipping_phone ⇒ Boolean
Request an extra phone number for shipping address (default:
false). -
#always_put_site_name_in_title ⇒ Boolean
When true, site name is always appended to titles on the frontend (default:
true). -
#auto_capture ⇒ Boolean
Automatically capture the credit card (as opposed to just authorize and capture later) (default:
false). -
#auto_capture_exchanges ⇒ Boolean
Automatically capture the credit card (as opposed to just authorize and capture later) (default:
false). -
#automatic_default_address ⇒ Boolean
The default value of true preserves existing backwards compatible feature of treating the most recently used address in checkout as the user’s default address.
-
#available_currencies ⇒ Array
An array of available currencies from Money::Currency.all.
-
#billing_address_required ⇒ Boolean
Controls whether billing address is required or not in the checkout process by default, can be overridden at order level.
-
#brand_selector_class ⇒ Class
Allows finding brand for product.
-
#can_restrict_stock_management ⇒ Boolean
Indicates if stock management can be restricted by location.
-
#carton_shipped_email_class ⇒ ActionMailer::Base
Allows providing your own Mailer for shipped cartons.
-
#checkout_zone ⇒ String
Name of a Zone, which limits available countries to those included in that zone.
-
#company ⇒ Boolean
Request company field for billing and shipping addresses.
-
#completable_order_created_cutoff ⇒ Integer
The number of days to look back for updated orders which get returned to the user as last completed.
-
#countries_that_use_nested_subregions ⇒ Array
of the default subregions that come with Carmen.
-
#credit_to_new_allocation ⇒ Boolean
Creates a new allocation anytime StoreCredit#credit is called.
-
#currency ⇒ String
Currency to use by default when not defined on the site (default: “USD”).
-
#current_store_selector_class ⇒ Class
Allows providing your own class for choosing which store to use.
-
#customer_returns_per_page ⇒ Integer
Customer returns to show per-page in the admin (default:
15). -
#default_country_iso ⇒ String
Default customer country ISO code.
-
#default_email_regexp ⇒ Regexp
Regex to be used in email validations, for example in Spree::EmailValidator.
-
#default_payment_builder_class ⇒ Class
Allows providing your own class for adding default payments to a user’s order from their “wallet”.
-
#generate_api_key_for_all_roles ⇒ Boolean
at role_user creation for all roles.
-
#guest_token_cookie_options ⇒ Hash
Add additional guest_token cookie options here (ie. domain or path).
-
#image_attachment_module ⇒ Module
Allows switching attachment library for Image.
-
#inventory_cache_threshold ⇒ Integer
Only invalidate product caches when the count on hand for a stock item falls below or rises about the inventory_cache_threshold.
-
#item_total_class ⇒ Class
Allows providing your own class for recalculating totals on an item.
-
#layout ⇒ String
Template to use for layout on the frontend (default: “spree/layouts/spree_application”).
-
#log_entry_allow_aliases ⇒ Boolean
Whether YAML aliases are allowed when loading serialized data in LogEntry.
-
#log_entry_permitted_classes ⇒ Array<String>
An array of extra classes that are allowed to be loaded from a serialized YAML as details in LogEntry (defaults to a non-frozen empty array, so that extensions can add their own classes).
-
#logo ⇒ String
URL of logo used on frontend (default: ‘logo/solidus.svg’).
-
#max_level_in_taxons_menu ⇒ Integer
Maximum nesting level in taxons menu (default:
1). -
#mergeable_orders_finder_class ⇒ Class
Allows providing your own class for selecting which orders to merge.
-
#meta_data_max_key_length ⇒ Integer
Maximum length that key can have in customer and admin metadata column (default:
16). -
#meta_data_max_keys ⇒ Integer
Maximum keys that can be allocated in customer and admin metadata column (default:
6). -
#meta_data_max_value_length ⇒ Integer
Maximum length that value can have in customer and admin metadata column (default:
256). -
#meta_data_validation_enabled ⇒ Boolean
When this is set to true, the following preferences will be used to validate the metadata: - The maximum number of keys that can be added to the metadata columns (meta_data_max_keys).
-
#migration_path ⇒ Pathname
Configures the absolute path that contains the Solidus engine migrations.
-
#order_bill_address_used ⇒ Boolean
bill addresses on payment sources.
-
#order_cancellations_class ⇒ Class
Allows providing your own class for managing the inventory units of a completed order.
-
#order_capturing_time_window ⇒ Integer
The number of days to look back for fully-shipped/cancelled orders in order to charge for them.
-
#order_contents_class ⇒ Class
Allows providing your own class for managing the contents of an order.
-
#order_mailer_class ⇒ ActionMailer::Base
Allows providing your own Mailer for order mailer.
-
#order_merger_class ⇒ Class
Allows providing your own class for merging two orders.
-
#order_mutex_max_age ⇒ Integer
Max age of OrderMutex in seconds (default: 2 minutes).
-
#order_number_generator ⇒ Class
Allows providing your own class instance for generating order numbers.
-
#order_recalculator_class ⇒ Class
Allows providing a different order recalculator.
-
#order_shipping_class ⇒ Class
Allows providing your own class for shipping an order.
-
#order_update_attributes_class ⇒ Class
Allows providing your own order update attributes class for checkout.
-
#orders_per_page ⇒ Integer
Orders to show per-page in the admin (default:
15). -
#payment_canceller ⇒ Class
Allows providing your own class for canceling payments.
-
#product_gallery_class ⇒ Class
Allows providing your own class for image galleries on Products.
-
#product_image_style_default ⇒ Symbol
Defines which style to default to when style is not provided :product is the default.
-
#product_image_styles ⇒ Hash
Defines image styles/sizes hash for styles ‘{ mini: ’48x48>‘, small: ’400x400>‘, product: ’680x680>‘, large: ’1200x1200>‘ } is the default.
-
#products_per_page ⇒ Integer
Products to show per-page in the frontend (default:
12). -
#promotions ⇒ Spree::Core::NullPromotionConfiguration
Allows providing your own promotion configuration instance.
-
#properties_per_page ⇒ Integer
Properties to show per-page in the admin (default:
15). -
#recalculate_cart_prices ⇒ Boolean
Whether to recalculate cart prices when recalculating (default:
false). -
#reimbursement_mailer_class ⇒ ActionMailer::Base
Allows providing your own Mailer for reimbursement mailer.
-
#require_master_price ⇒ Boolean
Require a price on the master variant of a product (default:
true). -
#require_payment_to_ship ⇒ Boolean
Allows shipments to be ready to ship regardless of the order being paid if false (default:
true). -
#return_eligibility_number_of_days ⇒ Integer
Default: 365.
-
#roles_for_auto_api_key ⇒ Array
at role_user creation is desired when user has one of these roles.
-
#send_core_emails ⇒ Boolean
Whether to send transactional emails (default: true).
-
#shipping_instructions ⇒ Boolean
Request instructions/info for shipping (default:
false). -
#shipping_rate_tax_calculator_class ⇒ Class
Allows providing your own class for calculating taxes on a shipping rate.
-
#show_only_complete_orders_by_default ⇒ Boolean
Only show completed orders by default in the admin (default:
true). -
#show_products_without_price ⇒ Boolean
Whether products without a price are visible in the frontend (default:
false). -
#show_raw_product_description ⇒ Boolean
Don’t escape HTML of product descriptions.
-
#show_variant_full_price ⇒ Boolean
Displays variant full price or difference with product price.
-
#state_change_tracking_class ⇒ Class
Allows to provide your own class for tracking state changes of stateful models.
-
#store_credit_prioritizer_class ⇒ Class
Allows providing your own class for prioritizing store credit application to an order.
-
#tax_adjuster_class ⇒ Class
Allows providing your own class for calculating taxes on an order.
-
#tax_calculator_class ⇒ Class
Allows providing your own class for calculating taxes on an order.
-
#tax_using_ship_address ⇒ Boolean
Use the shipping address rather than the billing address to determine tax (default:
true). -
#taxon_attachment_module ⇒ Module
Allows switching attachment library for Taxon.
-
#taxon_image_style_default ⇒ Symbol
Defines which style to default to when style is not provided :mini is the default.
-
#taxon_styles ⇒ Hash
Defines taxon styles/sizes hash for styles ‘{ mini: ’48x48>‘, small: ’400x400>‘, product: ’680x680>‘, large: ’1200x1200>‘ } is the default.
-
#taxon_url_parametizer_class ⇒ Class
Allows providing your own class for creating urls on taxons.
-
#track_inventory_levels ⇒ Object
Determines whether to track on_hand values for variants / products.
-
#unauthorized_redirect_handler_class ⇒ Class
Allows changing the default behavior for redirects when a user is not authorized.
-
#variant_gallery_class ⇒ Class
Allows providing your own class for image galleries on Variants.
-
#variant_price_selector_class ⇒ Class
Allows implementing custom pricing for variants.
-
#variant_vat_prices_generator_class ⇒ Class
Allows implementing custom vat prices generation.
Attributes inherited from Preferences::Configuration
#load_defaults_called, #loaded_defaults, #preference_store
Instance Method Summary collapse
-
#admin_vat_location ⇒ Spree::Tax::TaxLocation
Default admin VAT location.
-
#default_pricing_options ⇒ variant_price_selector_class
Shortcut for the default pricing options.
- #environment ⇒ Object
-
#pricing_options_class ⇒ Class
Shortcut for getting the variant price selector’s pricing options class.
- #promotion_adjuster_class ⇒ Object
- #promotion_adjuster_class=(klass) ⇒ Object
- #roles ⇒ Object
- #state_machines ⇒ Object
- #static_model_preferences ⇒ Object
- #stock ⇒ Object
- #user_last_url_storer_rules ⇒ Object
Methods inherited from Preferences::Configuration
#check_load_defaults_called, class_name_attribute, #configure, inherited, #initialize, #load_defaults, preference, #reset, #set, #use_legacy_db_preferences!, #use_static_preferences!, versioned_preference
Methods included from Preferences::Preferable
#admin_form_preference_names, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Constructor Details
This class inherits a constructor from Spree::Preferences::Configuration
Instance Attribute Details
#add_payment_sources_to_wallet_class ⇒ Class
Allows providing your own class for adding payment sources to a user’s “wallet” after an order moves to the complete state.
471 |
# File 'lib/spree/app_configuration.rb', line 471 class_name_attribute :add_payment_sources_to_wallet_class, default: "Spree::Wallet::AddPaymentSourcesToWallet" |
#address_requires_phone ⇒ Boolean
Returns should phone number be required (default: true).
35 |
# File 'lib/spree/app_configuration.rb', line 35 preference :address_requires_phone, :boolean, default: true |
#address_requires_state ⇒ Boolean
Returns should state/state_name be required (default: true).
39 |
# File 'lib/spree/app_configuration.rb', line 39 preference :address_requires_state, :boolean, default: true |
#admin_interface_logo ⇒ String
Returns URL of logo used in admin (default: ‘logo/solidus.svg’).
43 |
# File 'lib/spree/app_configuration.rb', line 43 preference :admin_interface_logo, :string, default: "logo/solidus.svg" |
#admin_products_per_page ⇒ Integer
Returns Number of products to display in admin (default: 10).
47 |
# File 'lib/spree/app_configuration.rb', line 47 preference :admin_products_per_page, :integer, default: 10 |
#admin_variants_per_page ⇒ Integer
Returns Number of variants to display in admin (default: 20).
51 |
# File 'lib/spree/app_configuration.rb', line 51 preference :admin_variants_per_page, :integer, default: 20 |
#admin_vat_country_iso ⇒ String?
Set this if you want to enter prices in the backend including value added tax.
57 |
# File 'lib/spree/app_configuration.rb', line 57 preference :admin_vat_country_iso, :string, default: nil |
#allow_checkout_on_gateway_error ⇒ Boolean
Returns Allow checkout to complete after a failed payment (default: false).
61 |
# File 'lib/spree/app_configuration.rb', line 61 preference :allow_checkout_on_gateway_error, :boolean, default: false |
#allow_guest_checkout ⇒ Boolean
Returns When false, customers must create an account to complete an order (default: true).
65 |
# File 'lib/spree/app_configuration.rb', line 65 preference :allow_guest_checkout, :boolean, default: true |
#allow_return_item_amount_editing ⇒ Boolean
Returns Determines whether an admin is allowed to change a return item’s pre-calculated amount (default: false).
73 |
# File 'lib/spree/app_configuration.rb', line 73 preference :allow_return_item_amount_editing, :boolean, default: false |
#allowed_image_mime_types ⇒ Array
Defines which MIME types are allowed for images ‘%w(image/jpeg image/jpg image/png image/gif).freeze` is the default.
540 |
# File 'lib/spree/app_configuration.rb', line 540 class_name_attribute :allowed_image_mime_types, default: %w[image/jpeg image/jpg image/png image/gif].freeze |
#alternative_billing_phone ⇒ Boolean
Returns Request an extra phone number for bill address (default: false).
77 |
# File 'lib/spree/app_configuration.rb', line 77 preference :alternative_billing_phone, :boolean, default: false |
#alternative_shipping_phone ⇒ Boolean
Returns Request an extra phone number for shipping address (default: false).
81 |
# File 'lib/spree/app_configuration.rb', line 81 preference :alternative_shipping_phone, :boolean, default: false |
#always_put_site_name_in_title ⇒ Boolean
Returns When true, site name is always appended to titles on the frontend (default: true).
85 |
# File 'lib/spree/app_configuration.rb', line 85 preference :always_put_site_name_in_title, :boolean, default: true |
#auto_capture ⇒ Boolean
Setting this to true is not recommended. Performing an authorize and later capture has far superior error handing. VISA and MasterCard also require that shipments are sent within a certain time of the card being charged.
Returns Automatically capture the credit card (as opposed to just authorize and capture later) (default: false).
93 |
# File 'lib/spree/app_configuration.rb', line 93 preference :auto_capture, :boolean, default: false |
#auto_capture_exchanges ⇒ Boolean
Returns Automatically capture the credit card (as opposed to just authorize and capture later) (default: false).
97 |
# File 'lib/spree/app_configuration.rb', line 97 preference :auto_capture_exchanges, :boolean, default: false |
#automatic_default_address ⇒ Boolean
The default value of true preserves existing backwards compatible feature of treating the most recently used address in checkout as the user’s default address. Setting to false means that the user should manage their own default via some custom UI that uses AddressBookController.
105 |
# File 'lib/spree/app_configuration.rb', line 105 preference :automatic_default_address, :boolean, default: true |
#available_currencies ⇒ Array
Returns An array of available currencies from Money::Currency.all.
320 |
# File 'lib/spree/app_configuration.rb', line 320 attr_writer :available_currencies |
#billing_address_required ⇒ Boolean
Controls whether billing address is required or not in the checkout process by default, can be overridden at order level. (default: false)
112 |
# File 'lib/spree/app_configuration.rb', line 112 preference :billing_address_required, :boolean, default: false |
#brand_selector_class ⇒ Class
Allows finding brand for product.
584 |
# File 'lib/spree/app_configuration.rb', line 584 class_name_attribute :brand_selector_class, default: "Spree::TaxonBrandSelector" |
#can_restrict_stock_management ⇒ Boolean
Returns Indicates if stock management can be restricted by location.
116 |
# File 'lib/spree/app_configuration.rb', line 116 preference :can_restrict_stock_management, :boolean, default: false |
#carton_shipped_email_class ⇒ ActionMailer::Base
Allows providing your own Mailer for shipped cartons.
408 |
# File 'lib/spree/app_configuration.rb', line 408 class_name_attribute :carton_shipped_email_class, default: "Spree::CartonMailer" |
#checkout_zone ⇒ String
Returns Name of a Zone, which limits available countries to those included in that zone. (default: nil).
120 |
# File 'lib/spree/app_configuration.rb', line 120 preference :checkout_zone, :string, default: nil |
#company ⇒ Boolean
Returns Request company field for billing and shipping addresses. (default: false).
124 |
# File 'lib/spree/app_configuration.rb', line 124 preference :company, :boolean, default: false |
#completable_order_created_cutoff ⇒ Integer
Returns the number of days to look back for updated orders which get returned to the user as last completed.
128 |
# File 'lib/spree/app_configuration.rb', line 128 preference :completable_order_created_cutoff_days, :integer, default: nil |
#countries_that_use_nested_subregions ⇒ Array
of the default subregions that come with Carmen. Will be used on store creation to ensure the correct states are generated, and when running the states regenerate rake task. (default: [‘IT’])
277 |
# File 'lib/spree/app_configuration.rb', line 277 preference :countries_that_use_nested_subregions, :array, default: ["IT"] |
#credit_to_new_allocation ⇒ Boolean
Returns Creates a new allocation anytime StoreCredit#credit is called.
136 |
# File 'lib/spree/app_configuration.rb', line 136 preference :credit_to_new_allocation, :boolean, default: false |
#currency ⇒ String
Currency to use by default when not defined on the site (default: “USD”)
141 |
# File 'lib/spree/app_configuration.rb', line 141 preference :currency, :string, default: "USD" |
#current_store_selector_class ⇒ Class
Allows providing your own class for choosing which store to use.
501 |
# File 'lib/spree/app_configuration.rb', line 501 class_name_attribute :current_store_selector_class, default: "Spree::StoreSelector::ByServerName" |
#customer_returns_per_page ⇒ Integer
Returns Customer returns to show per-page in the admin (default: 15).
145 |
# File 'lib/spree/app_configuration.rb', line 145 preference :customer_returns_per_page, :integer, default: 15 |
#default_country_iso ⇒ String
Default customer country ISO code
150 |
# File 'lib/spree/app_configuration.rb', line 150 preference :default_country_iso, :string, default: "US" |
#default_email_regexp ⇒ Regexp
Returns Regex to be used in email validations, for example in Spree::EmailValidator.
154 |
# File 'lib/spree/app_configuration.rb', line 154 preference :default_email_regexp, :regexp, default: URI::MailTo::EMAIL_REGEXP |
#default_payment_builder_class ⇒ Class
Allows providing your own class for adding default payments to a user’s order from their “wallet”.
430 |
# File 'lib/spree/app_configuration.rb', line 430 class_name_attribute :default_payment_builder_class, default: "Spree::Wallet::DefaultPaymentBuilder" |
#generate_api_key_for_all_roles ⇒ Boolean
at role_user creation for all roles. (default: false)
159 |
# File 'lib/spree/app_configuration.rb', line 159 preference :generate_api_key_for_all_roles, :boolean, default: false |
#guest_token_cookie_options ⇒ Hash
Returns Add additional guest_token cookie options here (ie. domain or path).
69 |
# File 'lib/spree/app_configuration.rb', line 69 preference :guest_token_cookie_options, :hash, default: {} |
#image_attachment_module ⇒ Module
Allows switching attachment library for Image
‘Spree::Image::ActiveStorageAttachment` is the default and provides the Active Storage implementation.
Enumerable of images adhering to the present_image_class interface
532 |
# File 'lib/spree/app_configuration.rb', line 532 class_name_attribute :image_attachment_module, default: "Spree::Image::ActiveStorageAttachment" |
#inventory_cache_threshold ⇒ Integer
Only invalidate product caches when the count on hand for a stock item falls below or rises about the inventory_cache_threshold. When undefined, the product caches will be invalidated anytime the count on hand is changed.
166 |
# File 'lib/spree/app_configuration.rb', line 166 preference :inventory_cache_threshold, :integer |
#item_total_class ⇒ Class
Allows providing your own class for recalculating totals on an item.
478 |
# File 'lib/spree/app_configuration.rb', line 478 class_name_attribute :item_total_class, default: "Spree::ItemTotal" |
#layout ⇒ String
Returns template to use for layout on the frontend (default: “spree/layouts/spree_application”).
170 |
# File 'lib/spree/app_configuration.rb', line 170 preference :layout, :string, default: "spree/layouts/spree_application" |
#log_entry_allow_aliases ⇒ Boolean
Returns Whether YAML aliases are allowed when loading serialized data in LogEntry. It defaults to true. Depending on the source of your data, you may consider disabling it to prevent entity expansion attacks.
197 |
# File 'lib/spree/app_configuration.rb', line 197 preference :log_entry_allow_aliases, :boolean, default: true |
#log_entry_permitted_classes ⇒ Array<String>
Returns An array of extra classes that are allowed to be loaded from a serialized YAML as details in LogEntry (defaults to a non-frozen empty array, so that extensions can add their own classes).
190 |
# File 'lib/spree/app_configuration.rb', line 190 preference :log_entry_permitted_classes, :array, default: [] |
#logo ⇒ String
Returns URL of logo used on frontend (default: ‘logo/solidus.svg’).
181 |
# File 'lib/spree/app_configuration.rb', line 181 preference :logo, :string, default: "logo/solidus.svg" |
#max_level_in_taxons_menu ⇒ Integer
Returns maximum nesting level in taxons menu (default: 1).
201 |
# File 'lib/spree/app_configuration.rb', line 201 preference :max_level_in_taxons_menu, :integer, default: 1 |
#mergeable_orders_finder_class ⇒ Class
Allows providing your own class for selecting which orders to merge.
422 |
# File 'lib/spree/app_configuration.rb', line 422 class_name_attribute :mergeable_orders_finder_class, default: "Spree::MergeableOrdersFinder" |
#meta_data_max_key_length ⇒ Integer
Returns Maximum length that key can have in customer and admin metadata column (default: 16).
235 |
# File 'lib/spree/app_configuration.rb', line 235 preference :meta_data_max_key_length, :integer, default: 16 |
#meta_data_max_keys ⇒ Integer
Returns Maximum keys that can be allocated in customer and admin metadata column (default: 6).
231 |
# File 'lib/spree/app_configuration.rb', line 231 preference :meta_data_max_keys, :integer, default: 6 |
#meta_data_max_value_length ⇒ Integer
Returns Maximum length that value can have in customer and admin metadata column (default: 256).
239 |
# File 'lib/spree/app_configuration.rb', line 239 preference :meta_data_max_value_length, :integer, default: 256 |
#meta_data_validation_enabled ⇒ Boolean
When this is set to true, the following preferences will be used to validate the metadata:
-
The maximum number of keys that can be added to the metadata columns (meta_data_max_keys).
-
The maximum length of each key in the metadata columns (meta_data_max_key_length).
-
The maximum length of each value in the metadata columns (meta_data_max_value_length).
(default: false)
227 |
# File 'lib/spree/app_configuration.rb', line 227 preference :meta_data_validation_enabled, :boolean, default: false |
#migration_path ⇒ Pathname
Configures the absolute path that contains the Solidus engine migrations. This will be checked at app boot to confirm that all Solidus migrations are installed.
631 |
# File 'lib/spree/app_configuration.rb', line 631 attr_writer :migration_path |
#order_bill_address_used ⇒ Boolean
bill addresses on payment sources. (default: true)
206 |
# File 'lib/spree/app_configuration.rb', line 206 preference :order_bill_address_used, :boolean, default: true |
#order_cancellations_class ⇒ Class
Allows providing your own class for managing the inventory units of a completed order.
452 |
# File 'lib/spree/app_configuration.rb', line 452 class_name_attribute :order_cancellations_class, default: "Spree::OrderCancellations" |
#order_capturing_time_window ⇒ Integer
Returns the number of days to look back for fully-shipped/cancelled orders in order to charge for them.
210 |
# File 'lib/spree/app_configuration.rb', line 210 preference :order_capturing_time_window, :integer, default: 14 |
#order_contents_class ⇒ Class
Allows providing your own class for managing the contents of an order.
437 |
# File 'lib/spree/app_configuration.rb', line 437 class_name_attribute :order_contents_class, default: "Spree::SimpleOrderContents" |
#order_mailer_class ⇒ ActionMailer::Base
Allows providing your own Mailer for order mailer.
377 |
# File 'lib/spree/app_configuration.rb', line 377 class_name_attribute :order_mailer_class, default: "Spree::OrderMailer" |
#order_merger_class ⇒ Class
Allows providing your own class for merging two orders.
415 |
# File 'lib/spree/app_configuration.rb', line 415 class_name_attribute :order_merger_class, default: "Spree::OrderMerger" |
#order_mutex_max_age ⇒ Integer
Returns Max age of OrderMutex in seconds (default: 2 minutes).
214 |
# File 'lib/spree/app_configuration.rb', line 214 preference :order_mutex_max_age, :integer, default: 120 |
#order_number_generator ⇒ Class
Allows providing your own class instance for generating order numbers.
642 |
# File 'lib/spree/app_configuration.rb', line 642 attr_writer :order_number_generator |
#order_recalculator_class ⇒ Class
Allows providing a different order recalculator.
392 |
# File 'lib/spree/app_configuration.rb', line 392 class_name_attribute :order_recalculator_class, default: "Spree::OrderUpdater" |
#order_shipping_class ⇒ Class
Allows providing your own class for shipping an order.
444 |
# File 'lib/spree/app_configuration.rb', line 444 class_name_attribute :order_shipping_class, default: "Spree::OrderShipping" |
#order_update_attributes_class ⇒ Class
Allows providing your own order update attributes class for checkout.
384 |
# File 'lib/spree/app_configuration.rb', line 384 class_name_attribute :order_update_attributes_class, default: "Spree::OrderUpdateAttributes" |
#orders_per_page ⇒ Integer
Returns Orders to show per-page in the admin (default: 15).
218 |
# File 'lib/spree/app_configuration.rb', line 218 preference :orders_per_page, :integer, default: 15 |
#payment_canceller ⇒ Class
Allows providing your own class for canceling payments.
458 |
# File 'lib/spree/app_configuration.rb', line 458 attr_writer :payment_canceller |
#product_gallery_class ⇒ Class
Allows providing your own class for image galleries on Products
Enumerable of images adhering to the present_image_class interface
522 |
# File 'lib/spree/app_configuration.rb', line 522 class_name_attribute :product_gallery_class, default: "Spree::Gallery::ProductGallery" |
#product_image_style_default ⇒ Symbol
Defines which style to default to when style is not provided :product is the default.
548 |
# File 'lib/spree/app_configuration.rb', line 548 class_name_attribute :product_image_style_default, default: :product |
#product_image_styles ⇒ Hash
Defines image styles/sizes hash for styles ‘{ mini: ’48x48>‘,
small: '400x400>',
product: '680x680>',
large: '1200x1200>' } is the default.
559 560 561 562 |
# File 'lib/spree/app_configuration.rb', line 559 class_name_attribute :product_image_styles, default: {mini: "48x48>", small: "400x400>", product: "680x680>", large: "1200x1200>"} |
#products_per_page ⇒ Integer
Returns Products to show per-page in the frontend (default: 12).
247 |
# File 'lib/spree/app_configuration.rb', line 247 preference :products_per_page, :integer, default: 12 |
#promotions ⇒ Spree::Core::NullPromotionConfiguration
Allows providing your own promotion configuration instance
663 |
# File 'lib/spree/app_configuration.rb', line 663 attr_writer :promotions |
#properties_per_page ⇒ Integer
Returns Properties to show per-page in the admin (default: 15).
243 |
# File 'lib/spree/app_configuration.rb', line 243 preference :properties_per_page, :integer, default: 15 |
#recalculate_cart_prices ⇒ Boolean
Returns Whether to recalculate cart prices when recalculating (default: false).
251 |
# File 'lib/spree/app_configuration.rb', line 251 versioned_preference :recalculate_cart_prices, :boolean, initial_value: false, boundaries: {"5.0.0.alpha" => true} |
#reimbursement_mailer_class ⇒ ActionMailer::Base
Allows providing your own Mailer for reimbursement mailer.
400 |
# File 'lib/spree/app_configuration.rb', line 400 class_name_attribute :reimbursement_mailer_class, default: "Spree::ReimbursementMailer" |
#require_master_price ⇒ Boolean
Returns Require a price on the master variant of a product (default: true).
255 |
# File 'lib/spree/app_configuration.rb', line 255 preference :require_master_price, :boolean, default: true |
#require_payment_to_ship ⇒ Boolean
Returns Allows shipments to be ready to ship regardless of the order being paid if false (default: true).
259 |
# File 'lib/spree/app_configuration.rb', line 259 preference :require_payment_to_ship, :boolean, default: true |
#return_eligibility_number_of_days ⇒ Integer
Returns default: 365.
263 |
# File 'lib/spree/app_configuration.rb', line 263 preference :return_eligibility_number_of_days, :integer, default: 365 |
#roles_for_auto_api_key ⇒ Array
at role_user creation is desired when user has one of these roles. (default: [‘admin’])
269 |
# File 'lib/spree/app_configuration.rb', line 269 preference :roles_for_auto_api_key, :array, default: ["admin"] |
#send_core_emails ⇒ Boolean
Returns Whether to send transactional emails (default: true).
281 |
# File 'lib/spree/app_configuration.rb', line 281 preference :send_core_emails, :boolean, default: true |
#shipping_instructions ⇒ Boolean
Returns Request instructions/info for shipping (default: false).
285 |
# File 'lib/spree/app_configuration.rb', line 285 preference :shipping_instructions, :boolean, default: false |
#shipping_rate_tax_calculator_class ⇒ Class
Allows providing your own class for calculating taxes on a shipping rate.
368 |
# File 'lib/spree/app_configuration.rb', line 368 class_name_attribute :shipping_rate_tax_calculator_class, default: "Spree::TaxCalculator::ShippingRate" |
#show_only_complete_orders_by_default ⇒ Boolean
Returns Only show completed orders by default in the admin (default: true).
289 |
# File 'lib/spree/app_configuration.rb', line 289 preference :show_only_complete_orders_by_default, :boolean, default: true |
#show_products_without_price ⇒ Boolean
Returns Whether products without a price are visible in the frontend (default: false).
297 |
# File 'lib/spree/app_configuration.rb', line 297 preference :show_products_without_price, :boolean, default: false |
#show_raw_product_description ⇒ Boolean
Returns Don’t escape HTML of product descriptions. (default: false).
301 |
# File 'lib/spree/app_configuration.rb', line 301 preference :show_raw_product_description, :boolean, default: false |
#show_variant_full_price ⇒ Boolean
Returns Displays variant full price or difference with product price. (default: false).
293 |
# File 'lib/spree/app_configuration.rb', line 293 preference :show_variant_full_price, :boolean, default: false |
#state_change_tracking_class ⇒ Class
Allows to provide your own class for tracking state changes of stateful models
569 |
# File 'lib/spree/app_configuration.rb', line 569 class_name_attribute :state_change_tracking_class, default: "Spree::StateChangeTracker" |
#store_credit_prioritizer_class ⇒ Class
Allows providing your own class for prioritizing store credit application to an order.
577 |
# File 'lib/spree/app_configuration.rb', line 577 class_name_attribute :store_credit_prioritizer_class, default: "Spree::StoreCreditPrioritizer" |
#tax_adjuster_class ⇒ Class
Allows providing your own class for calculating taxes on an order.
This extension point is under development and may change in a future minor release.
487 |
# File 'lib/spree/app_configuration.rb', line 487 class_name_attribute :tax_adjuster_class, default: "Spree::Tax::OrderAdjuster" |
#tax_calculator_class ⇒ Class
Allows providing your own class for calculating taxes on an order.
494 |
# File 'lib/spree/app_configuration.rb', line 494 class_name_attribute :tax_calculator_class, default: "Spree::TaxCalculator::Default" |
#tax_using_ship_address ⇒ Boolean
Returns Use the shipping address rather than the billing address to determine tax (default: true).
305 |
# File 'lib/spree/app_configuration.rb', line 305 preference :tax_using_ship_address, :boolean, default: true |
#taxon_attachment_module ⇒ Module
Allows switching attachment library for Taxon
‘Spree::Taxon::ActiveStorageAttachment` is the default and provides the Active Storage implementation.
Enumerable of taxons adhering to the present_taxon_class interface
613 |
# File 'lib/spree/app_configuration.rb', line 613 class_name_attribute :taxon_attachment_module, default: "Spree::Taxon::ActiveStorageAttachment" |
#taxon_image_style_default ⇒ Symbol
Defines which style to default to when style is not provided :mini is the default.
592 |
# File 'lib/spree/app_configuration.rb', line 592 class_name_attribute :taxon_image_style_default, default: :mini |
#taxon_styles ⇒ Hash
Defines taxon styles/sizes hash for styles ‘{ mini: ’48x48>‘,
small: '400x400>',
product: '680x680>',
large: '1200x1200>' } is the default.
603 |
# File 'lib/spree/app_configuration.rb', line 603 class_name_attribute :taxon_image_styles, default: {mini: "32x32>", normal: "128x128>"} |
#taxon_url_parametizer_class ⇒ Class
Allows providing your own class for creating urls on taxons
returns a String
508 |
# File 'lib/spree/app_configuration.rb', line 508 class_name_attribute :taxon_url_parametizer_class, default: "ActiveSupport::Inflector" |
#track_inventory_levels ⇒ Object
Determines whether to track on_hand values for variants / products. If you do not track inventory, or have effectively unlimited inventory for all products you can turn this on.
312 |
# File 'lib/spree/app_configuration.rb', line 312 preference :track_inventory_levels, :boolean, default: true |
#unauthorized_redirect_handler_class ⇒ Class
Allows changing the default behavior for redirects when a user is not authorized
620 |
# File 'lib/spree/app_configuration.rb', line 620 class_name_attribute :unauthorized_redirect_handler_class, default: "Spree::UnauthorizedRedirectHandler" |
#variant_gallery_class ⇒ Class
Allows providing your own class for image galleries on Variants
Enumerable of images adhering to the present_image_class interface
515 |
# File 'lib/spree/app_configuration.rb', line 515 class_name_attribute :variant_gallery_class, default: "Spree::Gallery::VariantGallery" |
#variant_price_selector_class ⇒ Class
Allows implementing custom pricing for variants
333 |
# File 'lib/spree/app_configuration.rb', line 333 class_name_attribute :variant_price_selector_class, default: "Spree::Variant::PriceSelector" |
#variant_vat_prices_generator_class ⇒ Class
Allows implementing custom vat prices generation
355 |
# File 'lib/spree/app_configuration.rb', line 355 class_name_attribute :variant_vat_prices_generator_class, default: "Spree::Variant::VatPriceGenerator" |
Instance Method Details
#admin_vat_location ⇒ Spree::Tax::TaxLocation
Default admin VAT location
An object that responds to :state_id and :country_id so it can double as a Spree::Address in Spree::Zone.for_address. Takes the ‘admin_vat_country_iso` as input.
764 765 766 767 768 |
# File 'lib/spree/app_configuration.rb', line 764 def admin_vat_location @default_tax_location ||= Spree::Tax::TaxLocation.new( country: Spree::Country.find_by(iso: admin_vat_country_iso) ) end |
#default_pricing_options ⇒ variant_price_selector_class
Shortcut for the default pricing options
343 344 345 |
# File 'lib/spree/app_configuration.rb', line 343 def .new end |
#environment ⇒ Object
720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 |
# File 'lib/spree/app_configuration.rb', line 720 def environment @environment ||= Spree::Core::Environment.new(self).tap do |env| env.calculators.shipping_methods = %w[ Spree::Calculator::Shipping::FlatPercentItemTotal Spree::Calculator::Shipping::FlatRate Spree::Calculator::Shipping::FlexiRate Spree::Calculator::Shipping::PerItem Spree::Calculator::Shipping::PriceSack ] env.calculators.tax_rates = %w[ Spree::Calculator::DefaultTax Spree::Calculator::FlatFee ] env.payment_methods = %w[ Spree::PaymentMethod::BogusCreditCard Spree::PaymentMethod::SimpleBogusCreditCard Spree::PaymentMethod::StoreCredit Spree::PaymentMethod::Check ] env.stock_splitters = %w[ Spree::Stock::Splitter::ShippingCategory Spree::Stock::Splitter::Backordered ] env.subscribers = %w[ Spree::CartonShippedMailerSubscriber Spree::OrderCancelMailerSubscriber Spree::OrderConfirmationMailerSubscriber Spree::OrderInventoryCancellationMailerSubscriber Spree::ReimbursementMailerSubscriber ] end end |
#pricing_options_class ⇒ Class
Shortcut for getting the variant price selector’s pricing options class
338 |
# File 'lib/spree/app_configuration.rb', line 338 delegate :pricing_options_class, to: :variant_price_selector_class |
#promotion_adjuster_class ⇒ Object
677 678 679 |
# File 'lib/spree/app_configuration.rb', line 677 def promotion_adjuster_class promotions.order_adjuster_class end |
#promotion_adjuster_class=(klass) ⇒ Object
681 682 683 |
# File 'lib/spree/app_configuration.rb', line 681 def promotion_adjuster_class=(klass) promotions.order_adjuster_class = klass end |
#roles ⇒ Object
707 708 709 710 711 712 |
# File 'lib/spree/app_configuration.rb', line 707 def roles @roles ||= Spree::RoleConfiguration.new.tap do |roles| roles. :default, ["Spree::PermissionSets::DefaultCustomer"] roles. :admin, ["Spree::PermissionSets::SuperUser"] end end |
#state_machines ⇒ Object
647 648 649 |
# File 'lib/spree/app_configuration.rb', line 647 def state_machines @state_machines ||= Spree::Core::StateMachines.new end |
#static_model_preferences ⇒ Object
651 652 653 |
# File 'lib/spree/app_configuration.rb', line 651 def static_model_preferences @static_model_preferences ||= Spree::Preferences::StaticModelPreferences.new end |
#stock ⇒ Object
655 656 657 |
# File 'lib/spree/app_configuration.rb', line 655 def stock @stock_configuration ||= Spree::Core::StockConfiguration.new end |
#user_last_url_storer_rules ⇒ Object
714 715 716 717 718 |
# File 'lib/spree/app_configuration.rb', line 714 def user_last_url_storer_rules @user_last_url_storer_rules ||= ::Spree::Core::ClassConstantizer::Set.new.tap do |set| set << "Spree::UserLastUrlStorer::Rules::AuthenticationRule" end end |