I’m trying to change my search so that it doesn’t bring products with a specific tag.
I managed to implement a logic in the search.liquid file to not display these products, but they are returned by the search engine causing a ‘blank gap’ in my grid of products displayed on the screen. I believe I should make the search engine not bring these products with the given tag so that my for loop doesn’t create this blank gap.
Has anyone had the same problem or can you help me with this?
You’ll need to build an AJAX based search system using the search APIs if you want to do this. Hiding a search item like this doesn’t remove it from the results array, so you’ll have gaps due to how Shopify paginates search results.
Searchanise indexes your store and allows you to control what you view within those results using the Pro Plan. It has a really nice UX which is highly customisable + less intrusive in that it progressively enhances your store compared to other apps which mess with your theme.
Thanks for the feedback, I’m testing this plug in and it seems to work fine.
I would also like to be able to filter my products by the order they appear in the search, for example if a user searches for a certain brand, the products are displayed in random order.
I would like to create a rule to for example display the search results first glasses, then bags, then wallets, etc.
My intention would be to manipulate the array that is returned in search.results and then go through the For loop.
I tried some solutions but they didn’t work, do you know if this is possible in any way?