Title: Compatibility with BeRocket Filter
Last modified: February 23, 2021

---

# Compatibility with BeRocket Filter

 *  Resolved [ilythia](https://wordpress.org/support/users/natureonemockups/)
 * (@natureonemockups)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-berocket-filter/)
 * Hi there!
 * I’m using Advanced Woo Search in combination with the BeRocket filter plugin 
   on my shop page. Now I have two options filtering…
 * 1. I use the AWS first and any BeRocket filter afterwards > works fine (both 
   filters are applied).
    2. I use the BeRocket filter first and AWS afterwards 
   > doesn’t work (only AWS filter is applied and BeRocket filter is cleared).
 * Is that normal? I wish it would work for both search variants. Please let me 
   know if that’s possible.
 * Another problem is that when I search for example for “red” it shows all red 
   products first but it lists all other products, too. What do I have to do to 
   see ONLY red products after my search?
 * Best,
    Ilythia

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [ILLID](https://wordpress.org/support/users/mihail-barinov/)
 * (@mihail-barinov)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-berocket-filter/#post-14096317)
 * Hello,
 * Please try to use following code snippet
 *     ```
       add_action( 'template_redirect', 'tp_redirects', 1 );
       function tp_redirects() {
   
           if ( isset( $_GET['type_aws'] ) && ! isset( $_GET['filters'] ) ) {
   
               $prev_url = $_SERVER['HTTP_REFERER'];
   
               if ( $prev_url ) {
                   $parse_url = parse_url( $prev_url );
                   if ( isset( $parse_url['query'] ) && $parse_url['query'] ) {
                       parse_str( $parse_url['query'], $prev_url_queries );
                       if ( isset( $prev_url_queries['filters'] ) ) {
                           $current_url = $_SERVER["REQUEST_URI"] . '&filters=' . $prev_url_queries['filters'];
                           wp_redirect( $current_url, 301 );
                           exit();
                       }
                   }
               }
   
           }
   
       }
       ```
   
 * You need to add it somewhere outside the plugins folder. For example, inside 
   functions.php file of your theme or use some plugin for adding code snippets.
 * This code will add BeRocket filter parameters to URL when using plugin search
   on a page where these filters were already applied.
 * Regards
 *  Thread Starter [ilythia](https://wordpress.org/support/users/natureonemockups/)
 * (@natureonemockups)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-berocket-filter/#post-14096871)
 * Hi there,
 * thanks for the code! I used Code Snippet to add it to my page but unfortunately
   nothing changed. :/
 * Best,
    Nancy
 *  Thread Starter [ilythia](https://wordpress.org/support/users/natureonemockups/)
 * (@natureonemockups)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-berocket-filter/#post-14098236)
 * Just found that there is a typo in:
 * `$current_url = $_SERVER["REQUEST_URI"] . '&filters=' . $prev_url_queries['filters'];`
 * URI = URL, I guess? But it’s still not working. 🙁
 *  [marketwo](https://wordpress.org/support/users/marketwo/)
 * (@marketwo)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-berocket-filter/#post-14105747)
 * hi, post search filters don’t work for me. Always return 0 results
    -  This reply was modified 5 years, 3 months ago by [marketwo](https://wordpress.org/support/users/marketwo/).
    -  This reply was modified 5 years, 3 months ago by [marketwo](https://wordpress.org/support/users/marketwo/).
 *  Plugin Author [ILLID](https://wordpress.org/support/users/mihail-barinov/)
 * (@mihail-barinov)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-berocket-filter/#post-14115935)
 * [@natureonemockups](https://wordpress.org/support/users/natureonemockups/)
 * No, there is no typo.
 * One more question – do you use BeRocket filter with ajax filtering? If so – please
   try to temporarily disable this ajax feature and test one more time with the 
   code that I provided previously.
 * Regards
 *  Thread Starter [ilythia](https://wordpress.org/support/users/natureonemockups/)
 * (@natureonemockups)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-berocket-filter/#post-14116255)
 * Without AJAX enabled it’s working! 🙂 But there is no way to make it work without
   disabling AJAX (due to faster loading), isn’t it?
 * Thanks so much for taking the time to look into that!
 *  Plugin Author [ILLID](https://wordpress.org/support/users/mihail-barinov/)
 * (@mihail-barinov)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-berocket-filter/#post-14122943)
 * Looks like I understand how to help you. You can still use AJAX filter but please
   go to the BeRocket settings page and inside SEO tab enable ‘Refresh URL when 
   filtering’ option. This must solve the issue.
 *  Thread Starter [ilythia](https://wordpress.org/support/users/natureonemockups/)
 * (@natureonemockups)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-berocket-filter/#post-14123033)
 * Now it works just perfectly! Thanks so much!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Compatibility with BeRocket Filter’ is closed to new replies.

 * ![](https://ps.w.org/advanced-woo-search/assets/icon-256x256.png?rev=3303984)
 * [Advanced Woo Search - Product Search for WooCommerce](https://wordpress.org/plugins/advanced-woo-search/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-woo-search/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-woo-search/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-woo-search/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-woo-search/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-woo-search/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [ilythia](https://wordpress.org/support/users/natureonemockups/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/compatibility-with-berocket-filter/#post-14123033)
 * Status: resolved