I need to add a search bar right below the Main Menu at the top of my page. I want this to be always visible, instead of using the lens and emergent search drawer.
It’s ok if it involves using custom code, I just need a bit of help since I’m new at using Shopify and editing the code.
Currently, I’m using the Dawn theme.
After this, it would be good to know how to hide the lens search button next to the cart and account icons at the top (it would become redundant).
Wrap this code with an if statement to conditionally show or hide it. Replace the existing code with the following:
{% if template != 'search' %}
<!-- Your existing code for the search button here -->
{% endif %}
This code checks if the current page template is not the search page (template != 'search') and only displays the search button in that case.
Save the changes.
After making these modifications, you should have a search bar below the main menu, and the lens search button will be hidden except on the search page.
Remember to test your changes and make a backup of your theme before making any modifications to the code.