I have trouble with spree, and dont know how to deal with it. I can't change the main currency.
How can I do it?
I have trouble with spree, and dont know how to deal with it. I can't change the main currency.
How can I do it?
It's easier in Spree 2.0.0 and obviously it will work in previous versions of spree too.
Go to your config/initializers/spree.rb
and in Spree.config block write the following code.
Spree.config do |config|
config.currency = 'EUR'
end
If you just want to show some other currency sign in Spree than $ you have to change that in Rails locale file in your Spree project. Example for Estonian locale and Euro is on the below.
config/locales/et_rails.yml:
et:
number:
# Used in number_to_currency()
currency:
format:
# Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
format: "%n %u"
unit: "€"
# These three are to override number.format and are optional
separator: "."
delimiter: " "
precision: 2
Maybe other alternative is to use Multi Currency plugin: http://spreecommerce.com/extensions/94-spree-multi-currency
For spree 1.3.x, we have to set the :currency preference.
Eg. config/initializers/spree.rb
Spree.config do |config|
...
config.currency = 'EUR'
end
I tried in spree 0.11 with rails 2. To change currency or change other localization following things needs to be done.
modify spree.rb in your /config/initializers/ folder by adding this line:
Spree::Config.set(:default_locale => 'en')
Note: you can change default en with other language but .yml file names should change accordingly.
Restart your server and check the output.
© 2022 - 2024 — McMap. All rights reserved.