Open tasdendu opened 4 years ago
I am trying to figure this out too. This looks like a very basic step to be missing from the setup.
Edit: There is a field in the admin section. You basically add them in a field coma-separated. "USD, EUR" and they work.
Hi @tashi-179
I use this copy for Spree 4 https://github.com/spree-four/spree_multi_currency
Preferences are set in this file: https://github.com/spree-four/spree_multi_currency/blob/master/lib/spree_multi_currency/engine.rb
@Tashows Can you elaborate your solution a little more. Whereabout in the admin section?
Hi @Voyotel
I don't think you will find a fix for this from something in the admin, its happening because the preferences have not been initiated properly when the app loads.
What version of Spree are you using and what version of rails are you using?
@MatthewKennedy I'm in Spree 4.1 and rails 6.0.3
@Voyotel If you replace the spree-contrib version with this:
gem 'spree_multi_currency', github: 'spree-four/spree_multi_currency'
That should work fine.
The multi currency functionality is being built into Spree 4.2 so at some point that extension will be a legacy extension.
@MatthewKennedy Thanks! That worked :)
Hi all, adding this to the file application.rb helped me to resolve this problem
config.after_initialize do
Spree::Config.allow_currency_change = true
Spree::Config.show_currency_selector = true
Spree::Config.supported_currencies = 'GBP,USD,EUR'
end
@Voyotel If you replace the spree-contrib version with this:
gem 'spree_multi_currency', github: 'spree-four/spree_multi_currency'
That should work fine.
The multi currency functionality is being built into Spree 4.2 so at some point that extension will be a legacy extension.
This is not the solution. We should figure it out how to fix the current problem.
Hi all, adding this to the file application.rb helped me to resolve this problem
config.after_initialize do Spree::Config.allow_currency_change = true Spree::Config.show_currency_selector = true Spree::Config.supported_currencies = 'GBP,USD,EUR' end
This looks like promising solution. Let me check and see if it is working.
Hi all, adding this to the file application.rb helped me to resolve this problem
config.after_initialize do
Spree::Config.allow_currency_change = true
Spree::Config.show_currency_selector = true
Spree::Config.supported_currencies = 'GBP,USD,EUR'
end
This looks like promising solution. Let me check and see if it is working.
this did not work for me .... @tashi-179 and the repo seems to have moved @MatthewKennedy so I can't try your idea.
when I add the above I get app/models/spree/preferences/configuration.rb:64:in
method_missing': undefined method allow_currency_change=' for #<Spree::AppConfiguration:0x00007fb40d0e5f10> (NoMethodError)
so I remove the first line and so on...but no good
#
gem 'rails', '~> 6.0.3', '>= 6.0.3.4'
gem 'spree', '~> 4.1'
How do we define
supported_currencies
, I have tried all possible options likeNone of the above configuration work for me. Can some one help me please.