GET FREE VERSION GET THE PRO VERSION

Introducing New Filters: Filter by Current Page, User Device, or Search Term

Search Results Filters Overview

Advanced Woo Search PRO includes a built-in feature to create search result filters based on various parameters.

For example, you can filter WooCommerce product search results by product category, tag, visibility, attribute, stock status, and more.

Filtering parameters for product results

Filtering parameters for product results

You can create separate filters for all available result types: products, archive pages, and users.

Filters for different search result types

Filters for different search result types

Each type has its own set of available filtering parameters.

Additionally, you can combine these filters into AND/OR logical groups, allowing for the creation of complex search logic.

Example: Display only products in the search results with categories Hoodies OR Accessories, OR, if the current user is logged in, show all products instead.

Filter rules with complex logic

Filter rules with complex logic

As demonstrated, search result filters provide significant opportunities to create varied and precise filters for search results.

Starting from plugin version 3.14, even more filtering parameters are available.

You can now create filters based on the current page, the current user's device, and the current search term. These parameters are global, meaning they can be applied to all search result types.

Filter Results by Current Page

Filter the search results based on the page where the user is performing the search.

This filtering type includes several different parameters: current page name, current page template, current page type, and current page archives.

Filters based on the current page

Filters based on the current page


With these filters, you can create interesting filtering rules. You can show or hide products for specific pages, page types (e.g., single product, shop page, cart page), or archive pages (e.g., categories, tags, attributes).

How to Create a Filter Based on Current Page

Creating such filters is straightforward and requires only a few steps:

1. Install and activate the Advanced Woo Search PRO plugin. Ensure you have at least version 3.14.

2. Go to the plugin settings page -> Search Results tab and scroll down to the Filter Results section.

3. Create a new filter for any of the search result types: product, taxonomy archive page, or user.

4. Choose the filter type from the Current Page section that best suits your needs. For example, let’s create a filter to completely hide search results on the page named Sample Page and show them on all other pages.

Such a filter might look like this:

Current page -> equal to -> Sample page AND
Product -> not equal to -> Any product

OR

Current page -> not equal to -> Sample page AND
Product -> equal to -> Any product

Filter to hide search results for a specific page

Filter to hide search results for a specific page

5. Save all changes and check your search form. If the form is placed inside the Sample page, no search results will be shown.

Examples

Example 1: If the user is on the T-shirt category page -> show results only from this category. Otherwise, show products from all categories.

Filtering rules based on the current page type

Filtering rules based on the current page type

Search results containing the T-shirt category

Search results containing the T-shirt category

Note: We covered how to create search filters based on current taxonomy in this article.

Example 2: If the user is on the cart page -> show only products that have been added to the user's cart. In this case, we created a search form exclusively for In Cart products, simplifying navigation for these product.

Filtering rules for search form inside Cart page

Filtering rules for search form inside Cart page

Search results limited to products in the user's cart

Search results limited to products in the user's cart

Filter Results by Current Search Text

This is the most interesting search result filter. It allows you to create filters based on the current search text.

For text comparison, you can use operators such as equal to, not equal to, contains, and not contain.

Filter rule based on current search text

Filter rule based on current search text

This filter is incredibly powerful for creating advanced search functionalities. You can build a virtual assistant-type system based solely on this rule.

For example, if the user's search query contains the word popular - show only top-selling products.
If the user's search query contains the words sale and hoodie - show products from the Hoodie category that are on sale.

And so on. The possible use cases are limited only by your imagination.

If the user searches for 'hoodies sale' - show hoodies that is on sale

If the user searches for 'hoodies sale' - show hoodies that is on sale

How to Create a Filter Based on Current Search Text

Creating filtering rules based on the current search text is similar to creating filters for other parameters.

1. Install and activate the Advanced Woo Search PRO plugin. You need at least version 3.14.

2. Go to the plugin settings page -> Search Results tab and scroll down to the Filter Results section.

3. Create a new filter for any of the search result types: product, taxonomy archive page, or user.

4. Let’s create a filter for product search results. For example, set the following rules:

Current search text -> contains -> sale AND
Product is on sale -> equal to -> Yes
OR
Current search text -> not contains -> sale AND
Product -> equal to -> Any

This will show only On Sale products if the user's search text contains the word sale.

Filtering rules for the word 'Sale' inside a search query

Filtering rules for the word 'Sale' inside a search query

Show only "On Sale" products if the search query contains the word 'Sale'

Show only "On Sale" products if the search query contains the word 'Sale'

Examples

Example 1: If the user's search query contains the word Featured - show only featured products.
This way, we can promote all our featured products and enhance the user experience.

Filtering rules for the word 'Featured' inside a search query

Filtering rules for the word 'Featured' inside a search query

Show only featured products if the search query contains the word 'Featured'

Show only featured products if the search query contains the word 'Featured'


[screen - Show only featured products if the search query contains the word 'Featured']

Example 2: If the user's search query contains the word Hoodie - show only products from the Hoodies category. You can create filters for any other category in the same way: Shoes, T-shirts, Hats, etc.

Filtering rules for the word 'Hoodie' inside a search query

Filtering rules for the word 'Hoodie' inside a search query

Show only products from the Hoodies category if the search query contains the word 'Hoodie'

Show only products from the Hoodies category if the search query contains the word 'Hoodie'

Example 3: If the user's search query contains the words size and medium - show only products with the attribute Size equal to Medium. You can create similar filters for any other sizes.

Filtering rules for the words 'size medium'

Filtering rules for the words 'size medium'

Show only products with the attribute Size equal to Medium if the search query contains the words 'size medium'

Show only products with the attribute Size equal to Medium if the search query contains the words 'size medium'

Filter Results by the User's Current Device

Filters based on the current user device

Filters based on the current user device

With these new search result filters, you can show or hide results based on the user's current device: mobile or desktop.

Examples

For example, you can hide products from a specific category in search results if the user is viewing your shop from a mobile device.

Hide products with specific category on mobile search results

Hide products with specific category on mobile search results

Comments

Download free version

Download free version from wordpress.org repository.

Purchase pro version

Read about differences between free and pro versions here.