Skip to content

Seach not working if width >992px #2

@technq

Description

@technq

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions