Skip to content

Instantly share code, notes, and snippets.

@daffydowden
Created November 16, 2011 20:33
Show Gist options
  • Save daffydowden/1371287 to your computer and use it in GitHub Desktop.
Save daffydowden/1371287 to your computer and use it in GitHub Desktop.
Spree setup config. Place this within config/initializers
# Spree setup instructions
# Setup the default preferences
if Preference.table_exists?
# Site defaults
Spree::Config.set(:site_name => 'Classy Site Name')
Spree::Config.set(:default_seo_title => 'Marketing Stuff')
Spree::Config.set(:default_meta_description => 'Longer Marketing Stuff')
Spree::Config.set(:default_meta_keywords => 'Marketing, Stuff')
# Domain name
if Rails.env.development?
Spree::Config.set(:site_url => 'mydomain.dev')
elsif Rails.env.production?
Spree::Config.set(:site_url => 'mydomain.com')
end
# Internationalisation options
Spree::Config.set(:default_locale => :'en-GB') # Includes translation and currency
Spree::Config.set(:default_country_id => 213)
Spree::Config.set(:address_requires_state => false)
Spree::Config.set(:logo => 'store/logos/revellum-w190px.png')
# Spree::Config.set(:show_price_inc_vat, true)
# Spree::Config.set(:shipment_inc_vat => false)
end
@femmestem
Copy link

femmestem commented Oct 19, 2016

@shivabhusal Since this gist is 5 years old the table names have changed. I'm on Spree 3.1, and the preferences table is called Spree::Preference. To see all the default preferences you can set open Rails console and run this command: Spree::Config.default_preferences then update the keys in this gist accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment