【问题标题】:Spree Mutli Currency Converter大礼包多货币转换器
【发布时间】:2014-01-22 12:08:04
【问题描述】:

我正在为我的购物车使用 spree,我想要多币种支持,所以我在我的 gemfile 中使用下面的 gem

gem "spree_multi_currency", :git => "git://github.com/pronix/spree-multi-currency.git"

然后捆绑安装

rake spree_multi_currency:install:migrations
rake db:migrate

然后使用下面的代码加载货币

rake spree_multi_currency:currency:iso4217

现在我想从谷歌加载汇率并将美元设为默认货币 为此我在终端上输入它

rake spree_multi_currency:rates:google[USD]

但它会给出类似

的错误
Loads currency data from Google using #<Spree::Currency:0xb967020>

http://www.google.com/ig/calculator?hl=en&q=1INR%3D%3FEUR 耙中止! 757:意外标记在 /home/tps/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/common.rb:155:in parse' /home/tps/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/common.rb:155:inparse' /home/tps/.rvm/gems/ruby-2.0.0-p247/bundler/gems/spree-multi-currency-0abaa72ab8ed/lib/tasks/spree_multi_currency.rake:126:in block (4 levels) in <top (required)>' /home/tps/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:ineach' /home/tps/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.2/lib/active_record/relation/delegation.rb:13:in each' /home/tps/.rvm/gems/ruby-2.0.0-p247/bundler/gems/spree-multi-currency-0abaa72ab8ed/lib/tasks/spree_multi_currency.rake:122:inblock (3 级) in ' /home/tps/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in eval' /home/tps/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in' 任务:TOP => spree_multi_currency:rates:google (通过使用 --trace 运行任务查看完整跟踪)

我想为我的购物车提供多币种支持,请帮忙。

提前致谢

【问题讨论】:

    标签: ruby-on-rails-3 ruby-on-rails-4 gem spree spree-paypal-express


    【解决方案1】:

    从管理员端添加货币汇率。例如美元基本货币比在转换器中您选择您的货币(INR),设置名义汇率意味着 1 美元 = 63 INR,而不是名义您将 63 作为名义货币和 1 作为价值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多