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
Spree change default currency and Country
Asked Answered
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
Really useful thanks. Is there a list somewhere of other things that you can configure this way? I'm thinking whether you show 'state' etc. –
Mastitis
This caused db:schema:load to fail. Changing the last line to
end if Spree::Country.table_exists?
fixes it –
Fiorin Note: it is actually config/initializers/spree.rb (I tried to change it but the edit was rejected) Anyone help with this? –
Mancy
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
© 2022 - 2024 — McMap. All rights reserved.