Skip to content
This repository was archived by the owner on Feb 27, 2021. It is now read-only.

Taxons API endpoint fails due as 'supported_currencies' is undefined #92

Open
mdavo6 opened this issue Oct 11, 2019 · 0 comments
Open

Comments

@mdavo6
Copy link

mdavo6 commented Oct 11, 2019

On Spree 3.1.

  1. Install spree_multi_currency gem.
  2. Click on "products --> taxons".
  3. Enter any taxon with products into the field and click.
  4. Products will not load as 'supported_currencies' is undefined.

Seems to be related to issue #42 raised by @jsilland. In short, this appears to occur because API controllers do not inherit from the ApplicationController, so do not have access to 'supported_currencies'.

I was able to resolve by creating a base_controller_decorator to include Spree::CurrencyHelpers, as suggested by @jsilland in issue #42 , per below:

Spree::Api::BaseController.class_eval do
   include Spree::CurrencyHelpers
end

Hope this helps anyone else who runs into this issue!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant