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

Seach not working if width >992px #2

Open
technq opened this issue May 17, 2020 · 0 comments
Open

Seach not working if width >992px #2

technq opened this issue May 17, 2020 · 0 comments

Comments

@technq
Copy link

technq commented May 17, 2020

When searching for any item in the store, it does not return any results. However, in the search field on the next screen, the results appear normally.
If the width is less than 991px it works OK.
I have found that this is because there are two sets of code for search on the page. The first one is only enabled when width is <992px.
This is caused by an error with line 57 of common.js not reading the correct search input field.
57 var value = $('header #search input[name='search']').val();
It always finds the the first instance of #search even when the second instance is active(>992px)

I have been able to fix this on my installation by editing the common/menu twig using the Theme Editor. Removing the second use of {{search}} and {{cart}} and moving the position of the first ones.
Resulting code for common/search.twig attached;
menufixed.twig.txt

; Seems to work well on all widths responsive.

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