Class: Spree::AppConfiguration
- Inherits:
-
Preferences::Configuration
- Object
- Preferences::Configuration
- Spree::AppConfiguration
- Defined in:
- app/models/spree/app_configuration.rb
Constant Summary collapse
- DEPRECATED_STORE_PREFERENCES =
all the following can be deprecated when store prefs are no longer supported
{ site_name: :name, site_url: :url, default_meta_description: :meta_description, default_meta_keywords: :meta_keywords, default_seo_title: :seo_title, }
Instance Attribute Summary collapse
-
#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
). -
#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
-
-
#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.
-
#create_rma_for_unreturned_exchange ⇒ Boolean
Allows rma to be created for items after unreturned exchange charge has been made (default:
false
). -
#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”).
-
#customer_returns_per_page ⇒ Integer
Customer returns to show per-page in the admin (default:
15
). - #default_country_id ⇒ Integer? deprecated Deprecated.
-
#expedited_exchanges ⇒ Boolean
Kicks off an exchange shipment upon return authorization save.
-
#expedited_exchanges_days_window ⇒ Integer
Number of days the customer has to return their item after the expedited exchange is shipped in order to avoid being charged (default:
14
). -
#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_mutex_max_age ⇒ Integer
Max age of OrderMutex in seconds (default: 2 minutes).
-
#orders_per_page ⇒ Integer
Orders to show per-page in the admin (default:
15
). -
#products_per_page ⇒ Integer
Products to show per-page in the frontend (default:
12
). - #promotion_chooser_class ⇒ Object
-
#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.
- #searcher_class ⇒ Object
-
#send_core_emails ⇒ Boolean
Whether to send transactional emails (default: true).
-
#shipping_instructions ⇒ Boolean
Request instructions/info for shipping (default:
false
). -
#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_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_search_class ⇒ Object
Attributes inherited from Preferences::Configuration
Instance Method Summary collapse
Methods inherited from Preferences::Configuration
#configure, preference, #reset, #set, #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
#address_requires_state ⇒ Boolean
Returns should state/state_name be required.
27 |
# File 'app/models/spree/app_configuration.rb', line 27 preference :address_requires_state, :boolean, default: true |
#admin_interface_logo ⇒ String
Returns URL of logo used in admin (default: ‘logo/solidus_logo.png’).
31 |
# File 'app/models/spree/app_configuration.rb', line 31 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
).
35 |
# File 'app/models/spree/app_configuration.rb', line 35 preference :admin_products_per_page, :integer, default: 10 |
#admin_variants_per_page ⇒ Integer
Returns Number of variants to display in admin (default: 20
).
39 |
# File 'app/models/spree/app_configuration.rb', line 39 preference :admin_variants_per_page, :integer, default: 20 |
#allow_checkout_on_gateway_error ⇒ Boolean
Returns Allow checkout to complete after a failed payment (default: false
).
43 |
# File 'app/models/spree/app_configuration.rb', line 43 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
).
47 |
# File 'app/models/spree/app_configuration.rb', line 47 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
).
51 |
# File 'app/models/spree/app_configuration.rb', line 51 preference :allow_return_item_amount_editing, :boolean, default: false |
#alternative_billing_phone ⇒ Boolean
Returns Request an extra phone number for bill address (default: false
).
55 |
# File 'app/models/spree/app_configuration.rb', line 55 preference :alternative_billing_phone, :boolean, default: false |
#alternative_shipping_phone ⇒ Boolean
Returns Request an extra phone number for shipping address (default: false
).
59 |
# File 'app/models/spree/app_configuration.rb', line 59 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
).
63 |
# File 'app/models/spree/app_configuration.rb', line 63 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.
71 |
# File 'app/models/spree/app_configuration.rb', line 71 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
).
75 |
# File 'app/models/spree/app_configuration.rb', line 75 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.
249 |
# File 'app/models/spree/app_configuration.rb', line 249 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
)
85 |
# File 'app/models/spree/app_configuration.rb', line 85 preference :binary_inventory_cache, :boolean, default: false |
#carton_shipped_email_class ⇒ ActionMailer::Base
Allows providing your own Mailer for shipped cartons.
274 |
# File 'app/models/spree/app_configuration.rb', line 274 attr_writer :carton_shipped_email_class |
#checkout_zone ⇒ String
Returns Name of a Zone, which limits available countries to those included in that zone. (default: nil
).
104 |
# File 'app/models/spree/app_configuration.rb', line 104 preference :checkout_zone, :string, default: nil |
#company ⇒ Boolean
Returns Request company field for billing and shipping addresses. (default: false
).
108 |
# File 'app/models/spree/app_configuration.rb', line 108 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.
89 |
# File 'app/models/spree/app_configuration.rb', line 89 preference :completable_order_created_cutoff_days, :integer, default: nil |
#create_rma_for_unreturned_exchange ⇒ Boolean
Returns allows rma to be created for items after unreturned exchange charge has been made (default: false
).
112 |
# File 'app/models/spree/app_configuration.rb', line 112 preference :create_rma_for_unreturned_exchange, :boolean, default: false |
#credit_to_new_allocation ⇒ Boolean
Returns Creates a new allocation anytime StoreCredit#credit is called.
241 |
# File 'app/models/spree/app_configuration.rb', line 241 preference :credit_to_new_allocation, :boolean, default: false |
#currency ⇒ String
Currency to use by default when not defined on the site (default: “USD”)
117 |
# File 'app/models/spree/app_configuration.rb', line 117 preference :currency, :string, default: "USD" |
#customer_returns_per_page ⇒ Integer
Returns Customer returns to show per-page in the admin (default: 15
).
182 |
# File 'app/models/spree/app_configuration.rb', line 182 preference :customer_returns_per_page, :integer, default: 15 |
#default_country_id ⇒ Integer?
Returns id of Country to be selected by default in dropdowns (default: nil).
122 |
# File 'app/models/spree/app_configuration.rb', line 122 preference :default_country_id, :integer |
#expedited_exchanges ⇒ Boolean
this requires payment profiles to be supported on your gateway of choice as well as a delayed job handler to be configured with activejob.
Kicks off an exchange shipment upon return authorization save. charge customer if they do not return items within timely manner.
131 |
# File 'app/models/spree/app_configuration.rb', line 131 preference :expedited_exchanges, :boolean, default: false |
#expedited_exchanges_days_window ⇒ Integer
Returns Number of days the customer has to return their item after the expedited exchange is shipped in order to avoid being charged (default: 14
).
137 |
# File 'app/models/spree/app_configuration.rb', line 137 preference :expedited_exchanges_days_window, :integer, default: 14 |
#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.
100 |
# File 'app/models/spree/app_configuration.rb', line 100 preference :inventory_cache_threshold, :integer |
#layout ⇒ String
Returns template to use for layout on the frontend (default: “spree/layouts/spree_application”).
141 |
# File 'app/models/spree/app_configuration.rb', line 141 preference :layout, :string, default: 'spree/layouts/spree_application' |
#logo ⇒ String
Returns URL of logo used on frontend (default: ‘logo/solidus_logo.png’).
145 |
# File 'app/models/spree/app_configuration.rb', line 145 preference :logo, :string, default: 'logo/solidus_logo.png' |
#mails_from ⇒ String
Returns Email address used as From:
field in transactional emails.
235 |
# File 'app/models/spree/app_configuration.rb', line 235 preference :mails_from, :string, :default => '[email protected]' |
#max_level_in_taxons_menu ⇒ Integer
Returns maximum nesting level in taxons menu (default: 1
).
158 |
# File 'app/models/spree/app_configuration.rb', line 158 preference :max_level_in_taxons_menu, :integer, default: 1 |
#order_bill_address_used ⇒ Boolean
bill addresses on payment sources. (default: true
)
150 |
# File 'app/models/spree/app_configuration.rb', line 150 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.
154 |
# File 'app/models/spree/app_configuration.rb', line 154 preference :order_capturing_time_window, :integer, default: 14 |
#order_mutex_max_age ⇒ Integer
Returns Max age of OrderMutex in seconds (default: 2 minutes).
162 |
# File 'app/models/spree/app_configuration.rb', line 162 preference :order_mutex_max_age, :integer, default: 120 |
#orders_per_page ⇒ Integer
Returns Orders to show per-page in the admin (default: 15
).
166 |
# File 'app/models/spree/app_configuration.rb', line 166 preference :orders_per_page, :integer, default: 15 |
#products_per_page ⇒ Integer
Returns Products to show per-page in the frontend (default: 12
).
174 |
# File 'app/models/spree/app_configuration.rb', line 174 preference :products_per_page, :integer, default: 12 |
#promotion_chooser_class ⇒ Object
264 265 266 |
# File 'app/models/spree/app_configuration.rb', line 264 def promotion_chooser_class @promotion_chooser_class ||= Spree::PromotionChooser end |
#promotions_per_page ⇒ Integer
Returns Promotions to show per-page in the admin (default: 15
).
178 |
# File 'app/models/spree/app_configuration.rb', line 178 preference :promotions_per_page, :integer, default: 15 |
#properties_per_page ⇒ Integer
Returns Properties to show per-page in the admin (default: 15
).
170 |
# File 'app/models/spree/app_configuration.rb', line 170 preference :properties_per_page, :integer, default: 15 |
#require_master_price ⇒ Boolean
Returns Require a price on the master variant of a product (default: true
).
186 |
# File 'app/models/spree/app_configuration.rb', line 186 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
).
190 |
# File 'app/models/spree/app_configuration.rb', line 190 preference :require_payment_to_ship, :boolean, default: true |
#return_eligibility_number_of_days ⇒ Integer
Returns default: 365.
194 |
# File 'app/models/spree/app_configuration.rb', line 194 preference :return_eligibility_number_of_days, :integer, default: 365 |
#searcher_class ⇒ Object
253 254 255 |
# File 'app/models/spree/app_configuration.rb', line 253 def searcher_class @searcher_class ||= Spree::Core::Search::Base end |
#send_core_emails ⇒ Boolean
Returns Whether to send transactional emails (default: true).
231 |
# File 'app/models/spree/app_configuration.rb', line 231 preference :send_core_emails, :boolean, default: true |
#shipping_instructions ⇒ Boolean
Returns Request instructions/info for shipping (default: false
).
198 |
# File 'app/models/spree/app_configuration.rb', line 198 preference :shipping_instructions, :boolean, default: false |
#show_only_complete_orders_by_default ⇒ Boolean
Returns Only show completed orders by default in the admin (default: true
).
202 |
# File 'app/models/spree/app_configuration.rb', line 202 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
).
210 |
# File 'app/models/spree/app_configuration.rb', line 210 preference :show_products_without_price, :boolean, default: false |
#show_raw_product_description ⇒ Boolean
Returns Don’t escape HTML of product descriptions. (default: false
).
214 |
# File 'app/models/spree/app_configuration.rb', line 214 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
).
206 |
# File 'app/models/spree/app_configuration.rb', line 206 preference :show_variant_full_price, :boolean, default: false |
#tax_using_ship_address ⇒ Boolean
Returns Use the shipping address rather than the billing address to determine tax (default: true
).
218 |
# File 'app/models/spree/app_configuration.rb', line 218 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.
225 |
# File 'app/models/spree/app_configuration.rb', line 225 preference :track_inventory_levels, :boolean, default: true |
Instance Method Details
#static_model_preferences ⇒ Object
279 280 281 |
# File 'app/models/spree/app_configuration.rb', line 279 def static_model_preferences @static_model_preferences ||= Spree::Preferences::StaticModelPreferences.new end |