Class: Spree::AppConfiguration
- Inherits:
-
Preferences::Configuration
- Object
- Preferences::Configuration
- Spree::AppConfiguration
- 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_state ⇒ Boolean
Should state/state_name be required.
-
#admin_interface_logo ⇒ String
URL of logo used in admin (default: ‘logo/solidus_logo.png’).
-
#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
). -
#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
Perform a sale/purchase transaction at checkout instead of a authorize and capture.
-
#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.
-
#binary_inventory_cache ⇒ Boolean
deprecated
Deprecated.
-
use inventory_cache_threshold instead
-
-
#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.
-
#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_id ⇒ Integer?
deprecated
Deprecated.
Use the default country ISO preference instead
-
#default_country_iso ⇒ String
Default customer country ISO code.
-
#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.
-
#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.
-
#layout ⇒ String
Template to use for layout on the frontend (default: “spree/layouts/spree_application”).
-
#logo ⇒ String
URL of logo used on frontend (default: ‘logo/solidus_logo.png’).
-
#mails_from ⇒ String
Email address used as
From:
field in transactional emails. -
#max_level_in_taxons_menu ⇒ Integer
Maximum nesting level in taxons menu (default:
1
). -
#order_bill_address_used ⇒ Boolean
bill addresses on payment sources.
-
#order_capturing_time_window ⇒ Integer
The number of days to look back for fully-shipped/cancelled orders in order to charge for them.
-
#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.
-
#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.
-
#products_per_page ⇒ Integer
Products to show per-page in the frontend (default:
12
). -
#promotions_per_page ⇒ Integer
Promotions to show per-page in the admin (default:
15
). -
#properties_per_page ⇒ Integer
Properties to show per-page in the admin (default:
15
). -
#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.
-
#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
). -
#track_inventory_levels ⇒ Object
Determines whether to track on_hand values for variants / products.
-
#variant_price_selector_class ⇒ Class
Allows implementing custom pricing for variants.
Attributes inherited from Preferences::Configuration
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.
-
#pricing_options_class ⇒ Class
Shortcut for getting the variant price selector’s pricing options class.
- #static_model_preferences ⇒ Object
- #stock ⇒ Object
Methods inherited from Preferences::Configuration
class_name_attribute, #configure, preference, #reset, #set, #use_legacy_db_preferences!, #use_static_preferences!
Methods included from Preferences::Preferable
#default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
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.
340 |
# File 'lib/spree/app_configuration.rb', line 340 class_name_attribute :add_payment_sources_to_wallet_class, default: 'Spree::Wallet::AddPaymentSourcesToWallet' |
#address_requires_state ⇒ Boolean
Returns should state/state_name be required.
28 |
# File 'lib/spree/app_configuration.rb', line 28 preference :address_requires_state, :boolean, default: true |
#admin_interface_logo ⇒ String
Returns URL of logo used in admin (default: ‘logo/solidus_logo.png’).
32 |
# File 'lib/spree/app_configuration.rb', line 32 preference :admin_interface_logo, :string, default: 'logo/solidus_logo.png' |
#admin_products_per_page ⇒ Integer
Returns Number of products to display in admin (default: 10
).
36 |
# File 'lib/spree/app_configuration.rb', line 36 preference :admin_products_per_page, :integer, default: 10 |
#admin_variants_per_page ⇒ Integer
Returns Number of variants to display in admin (default: 20
).
40 |
# File 'lib/spree/app_configuration.rb', line 40 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.
130 |
# File 'lib/spree/app_configuration.rb', line 130 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
).
44 |
# File 'lib/spree/app_configuration.rb', line 44 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
).
48 |
# File 'lib/spree/app_configuration.rb', line 48 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
).
52 |
# File 'lib/spree/app_configuration.rb', line 52 preference :allow_return_item_amount_editing, :boolean, default: false |
#alternative_billing_phone ⇒ Boolean
Returns Request an extra phone number for bill address (default: false
).
56 |
# File 'lib/spree/app_configuration.rb', line 56 preference :alternative_billing_phone, :boolean, default: false |
#alternative_shipping_phone ⇒ Boolean
Returns Request an extra phone number for shipping address (default: false
).
60 |
# File 'lib/spree/app_configuration.rb', line 60 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
).
64 |
# File 'lib/spree/app_configuration.rb', line 64 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 Perform a sale/purchase transaction at checkout instead of a authorize and capture.
72 |
# File 'lib/spree/app_configuration.rb', line 72 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
).
76 |
# File 'lib/spree/app_configuration.rb', line 76 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.
253 |
# File 'lib/spree/app_configuration.rb', line 253 preference :automatic_default_address, :boolean, default: true |
#binary_inventory_cache ⇒ Boolean
-
use inventory_cache_threshold instead
Only invalidate product caches when they change from in stock to out of stock. By default, caches are invalidated on any change of inventory quantity. Setting this to true should make operations on inventory faster. (default: false
)
86 |
# File 'lib/spree/app_configuration.rb', line 86 preference :binary_inventory_cache, :boolean, default: false |
#can_restrict_stock_management ⇒ Boolean
Returns Indicates if stock management can be restricted by location.
257 |
# File 'lib/spree/app_configuration.rb', line 257 preference :can_restrict_stock_management, :boolean, default: false |
#carton_shipped_email_class ⇒ ActionMailer::Base
Allows providing your own Mailer for shipped cartons.
306 |
# File 'lib/spree/app_configuration.rb', line 306 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
).
105 |
# File 'lib/spree/app_configuration.rb', line 105 preference :checkout_zone, :string, default: nil |
#company ⇒ Boolean
Returns Request company field for billing and shipping addresses. (default: false
).
109 |
# File 'lib/spree/app_configuration.rb', line 109 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.
90 |
# File 'lib/spree/app_configuration.rb', line 90 preference :completable_order_created_cutoff_days, :integer, default: nil |
#credit_to_new_allocation ⇒ Boolean
Returns Creates a new allocation anytime StoreCredit#credit is called.
245 |
# File 'lib/spree/app_configuration.rb', line 245 preference :credit_to_new_allocation, :boolean, default: false |
#currency ⇒ String
Currency to use by default when not defined on the site (default: “USD”)
114 |
# File 'lib/spree/app_configuration.rb', line 114 preference :currency, :string, default: "USD" |
#current_store_selector_class ⇒ Class
Allows providing your own class for choosing which store to use.
365 |
# File 'lib/spree/app_configuration.rb', line 365 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
).
180 |
# File 'lib/spree/app_configuration.rb', line 180 preference :customer_returns_per_page, :integer, default: 15 |
#default_country_id ⇒ Integer?
Use the default country ISO preference instead
Returns id of Country to be selected by default in dropdowns (default: nil).
119 |
# File 'lib/spree/app_configuration.rb', line 119 preference :default_country_id, :integer |
#default_country_iso ⇒ String
Default customer country ISO code
124 |
# File 'lib/spree/app_configuration.rb', line 124 preference :default_country_iso, :string, default: 'US' |
#default_payment_builder_class ⇒ Class
Allows providing your own class for adding default payments to a user’s order from their “wallet”.
321 |
# File 'lib/spree/app_configuration.rb', line 321 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
)
135 |
# File 'lib/spree/app_configuration.rb', line 135 preference :generate_api_key_for_all_roles, :boolean, default: false |
#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.
101 |
# File 'lib/spree/app_configuration.rb', line 101 preference :inventory_cache_threshold, :integer |
#layout ⇒ String
Returns template to use for layout on the frontend (default: “spree/layouts/spree_application”).
139 |
# File 'lib/spree/app_configuration.rb', line 139 preference :layout, :string, default: 'spree/layouts/spree_application' |
#logo ⇒ String
Returns URL of logo used on frontend (default: ‘logo/solidus_logo.png’).
143 |
# File 'lib/spree/app_configuration.rb', line 143 preference :logo, :string, default: 'logo/solidus_logo.png' |
#mails_from ⇒ String
Returns Email address used as From:
field in transactional emails.
239 |
# File 'lib/spree/app_configuration.rb', line 239 preference :mails_from, :string, default: '[email protected]' |
#max_level_in_taxons_menu ⇒ Integer
Returns maximum nesting level in taxons menu (default: 1
).
156 |
# File 'lib/spree/app_configuration.rb', line 156 preference :max_level_in_taxons_menu, :integer, default: 1 |
#order_bill_address_used ⇒ Boolean
bill addresses on payment sources. (default: true
)
148 |
# File 'lib/spree/app_configuration.rb', line 148 preference :order_bill_address_used, :boolean, default: true |
#order_capturing_time_window ⇒ Integer
Returns the number of days to look back for fully-shipped/cancelled orders in order to charge for them.
152 |
# File 'lib/spree/app_configuration.rb', line 152 preference :order_capturing_time_window, :integer, default: 14 |
#order_merger_class ⇒ Class
Allows providing your own class for merging two orders.
313 |
# File 'lib/spree/app_configuration.rb', line 313 class_name_attribute :order_merger_class, default: 'Spree::OrderMerger' |
#order_mutex_max_age ⇒ Integer
Returns Max age of OrderMutex in seconds (default: 2 minutes).
160 |
# File 'lib/spree/app_configuration.rb', line 160 preference :order_mutex_max_age, :integer, default: 120 |
#order_number_generator ⇒ Class
Allows providing your own class instance for generating order numbers.
373 |
# File 'lib/spree/app_configuration.rb', line 373 attr_writer :order_number_generator |
#orders_per_page ⇒ Integer
Returns Orders to show per-page in the admin (default: 15
).
164 |
# File 'lib/spree/app_configuration.rb', line 164 preference :orders_per_page, :integer, default: 15 |
#payment_canceller ⇒ Class
Allows providing your own class for canceling payments.
327 |
# File 'lib/spree/app_configuration.rb', line 327 attr_writer :payment_canceller |
#products_per_page ⇒ Integer
Returns Products to show per-page in the frontend (default: 12
).
172 |
# File 'lib/spree/app_configuration.rb', line 172 preference :products_per_page, :integer, default: 12 |
#promotions_per_page ⇒ Integer
Returns Promotions to show per-page in the admin (default: 15
).
176 |
# File 'lib/spree/app_configuration.rb', line 176 preference :promotions_per_page, :integer, default: 15 |
#properties_per_page ⇒ Integer
Returns Properties to show per-page in the admin (default: 15
).
168 |
# File 'lib/spree/app_configuration.rb', line 168 preference :properties_per_page, :integer, default: 15 |
#require_master_price ⇒ Boolean
Returns Require a price on the master variant of a product (default: true
).
184 |
# File 'lib/spree/app_configuration.rb', line 184 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
).
188 |
# File 'lib/spree/app_configuration.rb', line 188 preference :require_payment_to_ship, :boolean, default: true |
#return_eligibility_number_of_days ⇒ Integer
Returns default: 365.
192 |
# File 'lib/spree/app_configuration.rb', line 192 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’])
198 |
# File 'lib/spree/app_configuration.rb', line 198 preference :roles_for_auto_api_key, :array, default: ['admin'] |
#send_core_emails ⇒ Boolean
Returns Whether to send transactional emails (default: true).
235 |
# File 'lib/spree/app_configuration.rb', line 235 preference :send_core_emails, :boolean, default: true |
#shipping_instructions ⇒ Boolean
Returns Request instructions/info for shipping (default: false
).
202 |
# File 'lib/spree/app_configuration.rb', line 202 preference :shipping_instructions, :boolean, default: false |
#shipping_rate_tax_calculator_class ⇒ Class
Allows providing your own class for calculating taxes on a shipping rate.
298 |
# File 'lib/spree/app_configuration.rb', line 298 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
).
206 |
# File 'lib/spree/app_configuration.rb', line 206 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
).
214 |
# File 'lib/spree/app_configuration.rb', line 214 preference :show_products_without_price, :boolean, default: false |
#show_raw_product_description ⇒ Boolean
Returns Don’t escape HTML of product descriptions. (default: false
).
218 |
# File 'lib/spree/app_configuration.rb', line 218 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
).
210 |
# File 'lib/spree/app_configuration.rb', line 210 preference :show_variant_full_price, :boolean, default: false |
#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.
350 |
# File 'lib/spree/app_configuration.rb', line 350 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.
358 |
# File 'lib/spree/app_configuration.rb', line 358 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
).
222 |
# File 'lib/spree/app_configuration.rb', line 222 preference :tax_using_ship_address, :boolean, default: true |
#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.
229 |
# File 'lib/spree/app_configuration.rb', line 229 preference :track_inventory_levels, :boolean, default: true |
#variant_price_selector_class ⇒ Class
Allows implementing custom pricing for variants
267 |
# File 'lib/spree/app_configuration.rb', line 267 class_name_attribute :variant_price_selector_class, default: 'Spree::Variant::PriceSelector' |
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.
393 394 395 396 397 |
# File 'lib/spree/app_configuration.rb', line 393 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
277 278 279 |
# File 'lib/spree/app_configuration.rb', line 277 def .new end |
#pricing_options_class ⇒ Class
Shortcut for getting the variant price selector’s pricing options class
272 |
# File 'lib/spree/app_configuration.rb', line 272 delegate :pricing_options_class, to: :variant_price_selector_class |
#static_model_preferences ⇒ Object
378 379 380 |
# File 'lib/spree/app_configuration.rb', line 378 def static_model_preferences @static_model_preferences ||= Spree::Preferences::StaticModelPreferences.new end |
#stock ⇒ Object
382 383 384 |
# File 'lib/spree/app_configuration.rb', line 382 def stock @stock_configuration ||= Spree::Core::StockConfiguration.new end |