Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change spree currency?

Tags:

spree

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?

like image 895
aXZ Avatar asked May 16 '11 21:05

aXZ


2 Answers

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
like image 131
Muhammad Ateq Ejaz Avatar answered Oct 22 '22 16:10

Muhammad Ateq Ejaz


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

like image 5
Priidik Vaikla Avatar answered Oct 22 '22 17:10

Priidik Vaikla