Phone :  +370 (5) 204-1903
Email: sales@1gbits.com
  1. Dedicated server
  2. Blog
  3. Introducing plugin WooCommerce Shop Filter

In this article, With the Introducing another one of other WordPress plugins are at your service.

Introducing plugin WooCommerce Shop Filter

Default WooCommerce shop page isn’t good enough for search and filter product as user needs, this plugin allows user to filter and search by their own needs and find the best product they are looking for.

Features plugin WooCommerce Shop Filter

  • Filter by keywords
  • Filter by product categories
  • Filter by product tags
  • Filter by price range
  • Filter by order & order by
  • Filter onsale product
  • Filter in-stock
  • Filter by SKU

How to use plugin WooCommerce Shop Filter?

Please go to “Widgets” page and see there is a widget “Woo Shop Filter”, you can use this on sidebars.
There is no option currently, we will update soon.


How to add custom search field and filter products?

you can add custom search field by action hook and filter products as well,

Step 1:

Add search input field

add_action('WooShopFilter_fields','WooShopFilter_field_my_custom_input', 30);
function WooShopFilter_field_my_custom_input(){

    $WooShopFilter = isset($_GET['WooShopFilter']) ? sanitize_text_field($_GET['WooShopFilter']) :""; // check this to ensure for is submitted from WooShopFilter.
    $_custom_input = isset($_GET['_custom_input']) ? sanitize_text_field($_GET['_custom_input']) :""; // Do not forget to sanitization

        $_custom_input = '';

     * you can check conditional here.
     * if(is_shop()):
     * execute code only shop page
     * endif;
     * */

        // this will only display under shop page and hide others page


Step 2

verify input variable and put on product query arguments

add_action( 'woocommerce_product_query', 'WooShopFilter_pre_get_posts_query_my_custom_input', 99 );
function WooShopFilter_pre_get_posts_query_my_custom_input( $query_args ){

    $WooShopFilter = isset($_GET['WooShopFilter']) ? sanitize_text_field($_GET['WooShopFilter']) : "";
    $_custom_input = isset($_GET['_custom_input']) ? sanitize_text_field($_GET['_custom_input']) :""; // Do not forget to sanitization

    if($WooShopFilter && $_custom_input){

        // you can get ans set query arguments
        // try var_dump($query_args) to see available query arguments, like tax_query, meta_query, order, orderby

        $s = $query_args->get( 's' );
        $query_args->set( 's', $_custom_input );


How to remove existing input fields?

By action hook you can simply remove any input fields exist.




How to install wordpress plugin WooCommerce Shop Filter:

  1. Upload the wordpress plugin WooCommerce Shop Filter files to the /wp-content/plugins/woo-shop-filter, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress

Download link

If you have a question about this article, You can let us know via comments and we will get back to you.

author img

Criss N

I’m a master graduate in ICT and my passion has been towards the software from a very young age. I’m also a professional athlete and a developer. I have more than 6 years of SEO experience, webmaster and a huge fan of wordpress. I love working with coding and also a fan of networking specialities.

Generic placeholder image

2018 Oct 12, 17:10:14

It agree, it is an amusing phrase

Leave A Comment