Spree change default currency and Country
Asked Answered
A

2

5

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

Alguire answered 21/9, 2012 at 4:57 Comment(0)
P
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
Payroll answered 3/7, 2013 at 11:47 Comment(3)
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 itFiorin
Note: it is actually config/initializers/spree.rb (I tried to change it but the edit was rejected) Anyone help with this?Mancy
S
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
Schmitt answered 14/6, 2019 at 8:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.