I am developing an e-commerce application using Spree for India. So all prices are in 'Rs' and states and zones are India related. I edited them easily in Spree 1.2.0 but I couldn't find those options in 1.1.3. How to customize this in 1.1.3
Asked
Active
Viewed 3,368 times
2 Answers
19
You can set these options in your app/config/initializers/spree.rb
Spree.config do |config|
# Set country name and currency like this (Note: you will need to
# run 'rake db:seed' before this. Change country name in
# Spree::Country.find_by_name('Germany') replace Germany to your desired one)
config.currency = 'EUR'
country = Spree::Country.find_by_name('Germany')
config.default_country_id = country.id if country.present?
# You can also set following options too.
config.site_name = "Todo Store"
config.override_actionmailer_config = true
config.enable_mail_delivery = true
end

notapatch
- 6,569
- 6
- 41
- 45

Muhammad Ateq Ejaz
- 1,845
- 20
- 22
-
1Really useful thanks. Is there a list somewhere of other things that you can configure this way? I'm thinking whether you show 'state' etc. – dwkns Mar 15 '16 at 10:30
-
This caused db:schema:load to fail. Changing the last line to `end if Spree::Country.table_exists?` fixes it – Qwertie Feb 20 '17 at 23:54
-
Note: it is actually config/initializers/spree.rb (I tried to change it but the edit was rejected) Anyone help with this? – notapatch Mar 17 '17 at 15:28
0
You can set these options in your app/config/initializers/spree.rb
Spree.config do |config|
config.currency = 'Rs'
config.default_country_id = 105 # Your default country id
end

HM Tanbir
- 990
- 12
- 30