spree-contrib / spree_multi_currency

Provides UI to allow configuring multiple currencies in Spree.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
41 stars 118 forks source link

allow_currency_change preference not defined #96

Closed MatthewKennedy closed 4 years ago

MatthewKennedy commented 4 years ago

Using a fresh setup of: Rails 6 Ruby 2.6.5 Spree 4.0.3

I get the error allow_currency_change preference not defined

Any suggestions?

MatthewKennedy commented 4 years ago

This seems to fix if you set autoloader to classic mode and re run the extension bundle installer.

I don’t understand exactly why.

Tashows commented 4 years ago

I am on rails 5.2.1 and am getting the same issue. What I did for now, is add

Spree::AppConfiguration.prepend(Spree::AppConfigurationDecorator)

in the spree initializer and then add the options

Spree::Config[:allow_currency_change] = true
Spree::Config[:show_currency_selector] = true
MatthewKennedy commented 4 years ago

@Tashows

I managed to get round it by using the method in the linked file: https://github.com/spree-four/spree_multi_currency/blob/master/lib/spree_multi_currency/engine.rb

I don't know if it's the right way to do it or not.