Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Variant Searcher for Autocomplete #4175

Closed
jarednorman opened this issue Sep 22, 2021 · 0 comments
Closed

Use Variant Searcher for Autocomplete #4175

jarednorman opened this issue Sep 22, 2021 · 0 comments

Comments

@jarednorman
Copy link
Member

When looking into this issue in solidus_globalize, it occurred to me that a possible solution that would I think be an improvement to Solidus and make that issue easy to fix would be to change the variant autocomplete widget to use the variant searcher, rather than a custom ransack query.

Making the variant autocomplete configurable (so that stores that translate the product name could change that query to product_translations_name_or_sku_cont wouldn't be excessively difficult, but our variant search class is already configurable and is already more flexible than this custom query. The solidus_globalize gem would just need to provide an initializer that updates this configuration to overcome the bug I reported if our variant autocomplete code used the variant search class.

My proposal is this:

  1. We add a new API endpoint or augment the existing API variants index action to allow for queries that search using the configured variant search class.
  2. We update the variant autocomplete code to use that new endpoint/parameter.
  3. In solidus_globalize, we provide some configuration to replace the fields that break when translated with ones that use the translations.

The end result is that we'd be able to resolve the issue on solidus_globalize and that the variant autocomplete fields in the admin would be a little nicer out of the box.

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

No branches or pull requests

1 participant