Req. Spree => 3
You can setup another currencies and rates.
Logic next:
- Get product.variant.currency
- If product.variant.currency == MainCurrency
- product.price * MainCurrency.rate # yep you can specified a main currency rate
- else product.price * product.variant.currency.rate
In admin panel in column price you can see product price in original currency and price in main currency if original currency exist.
Note: After install gem, all prices on your shop proceed this gem. Note: If you dont want change main currency rate, just create this currency with rate 1, you can see main currency rate in first fake row in "AdminPanel -> Rates" # its not bug, its feature
- Add this extension to your Gemfile with this line:
gem 'spree_custom_sale_rates_from_currency', github: 'restot/spree_custom_sale_rates_from_currency'
- Install the gem using Bundler:
bundle install
- Copy & run migrations
bundle exec rails g spree_custom_sale_rates_from_currency:install
- Restart your server
If your server was running, restart it so that it can find the assets properly.