How to change weight currency?

I have problems with fun and I don’t know how to handle it. I can’t change the main currency.

How can i do this?

+4
source share
4 answers

Spree 2.0.0 is simpler, and obviously it will work in previous versions of spree.

Go to config/initializers/spree.rb and in the Spree.config block write the following code.

 Spree.config do |config| config.currency = 'EUR' end 
+7
source

If you just want to show some other currency sign in Spree than $, you have to change this in the local Rails file in your Spree project. An example for the Estonian language and the euro is below.

configurations / 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 

Perhaps another alternative is to use the Multi Currency plugin: http://spreecommerce.com/extensions/94-spree-multi-currency

+5
source

For spree 1.3.x we have to set: currency preference.

Eg. config / Initializers / spree.rb

 Spree.config do |config| ... config.currency = 'EUR' end 
+3
source

I tried in spree 0.11 with rails 2. To change the currency or change a different localization, you need to follow these steps.

  • Copy the en_spree.yml file from the spree / config / locales / folder directory to the / config / locales / folder. (this file may be with a different name also depends on the default locale).
  • Save this file with en.yml also in the / config / locales / folder. Its replication.
  • Modification for any line or currency. For currency, follow the answer of Pridek Wikla.
  • change spree.rb in the / config / initializers / folder folder by adding this line:

    Spree :: Config.set (: default_locale => 'en')

Note: you can change the default value of en to another language, but the .yml file names should change accordingly.

Reboot the server and check the output.

+1
source

All Articles