PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Text Search Shortcode: Enter key reloads page instead of redirecting to shop page

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello support,

I have recently purchased the Premium version of HUSKY on CodeCanyon, and I'm trying to implement a text search in my site's main menu using the following shortcode:

[woof_text_filter redirect="https://quivesa.com.py/tienda/" how_to_open_links=1]

I want to provide two main experiences for my visitors:

  1. AJAX Search (Live results): When the user types and waits for the results to appear, then clicks on a specific product. This is currently working perfectly.

  2. Search by"Enter" key: When the user types a keyword and presses the"Enter" key, I want them to be redirected to the shop page with the filtered results (using the redirect URL provided in the shortcode).

The issue: When I press the"Enter" key, the page simply reloads without any search parameters in the URL and without redirecting to the shop page. It seems the redirect attribute is ignored when the form is submitted via the Enter key.

How can I make the Enter key respect the redirect URL and pass the search term as a HUSKY filter parameter?

Thank you in advance for your help.

Hello

Just checked text search on your site - its works as you asked: https://quivesa.com.py/tienda/swoof/name-bomba/ - I entered word 'bomba' and pressed Enter keyboard

What about redirect shortcode oprions, read please https://products-filter.com/shortcode/woof_text_filter - such one doesn exists, and if to press Enter keyboard its always lead to shop page

how_to_open_links: how open product page if to click on it in the results drop-down - related to products links in the search results

For further support please provide purchase code:

https://share.pluginus.net/image/i20230222134241.png
https://share.pluginus.net/image/i20230222134615.png
https://share.pluginus.net/image/i20230222134511.png

 

Hello Alex,

Thanks for your quick response. I have updated my Private data as requested.

I have found the exact cause of the issue. After replicating my homepage block by block, I discovered that the Husky Text Search shortcode fails ONLY when the 'Product Carousel' block from Kadence Blocks is present on the same page.

If I remove the Kadence Product Carousel, the 'Enter' key on the Husky search works perfectly. When the carousel is present, pressing 'Enter' just reloads the current page without the correct URL parameters (it tries to load /swoof/... instead of /tienda/swoof/...).

It seems there is a JavaScript conflict between how Kadence handles product data/events and how Husky captures the Enter key.

Are there any known compatibility fixes for Kadence Blocks, or a way to prevent the carousel script from interfering with the Husky search listener?

Hello

This is usual javascript incompatibility, and why support is here, I created script and placed it into file footer.php, and now it works, please test it:

add_action('wp_footer', function() {
    // Only on front page
    if (!is_front_page()) {
        return;
    }
    ?>
    <script>
    jQuery(document).ready(function($) {
        // Find HUSKY text input on front page
        $('.woof_husky_txt-input').on('keypress', function(e) {
            // If Enter key is pressed (code 13)
            if (e.which === 13 || e.keyCode === 13) {
                e.preventDefault(); // Stop default behavior
                e.stopPropagation(); // Stop event bubbling
                
                var searchValue = $(this).val().trim(); // Get value from input
                console.log(searchValue);
                if (searchValue.length > 0) {
                    // Build redirect URL
                    var redirectUrl = 'https://quivesa.com.py/tienda/swoof/name-' + encodeURIComponent(searchValue) + '/';
                    console.log(redirectUrl);
                    // Redirect to shop page with search parameter
                   //window.location.replace(redirectUrl);//doesn work
					
	           // Delay redirect to next event loop to avoid cancellation
                    setTimeout(function() {
                        window.location.href = redirectUrl;
                    }, 100);
                }
                
                return false;
            }
        });
    });
    </script>
    <?php
}, 1999);

Works only on front page as the slider is only there

 

Hello,

Thank you so much for your prompt and efficient response!

I have tested the snippet you added to the footer.php and it works perfectly on the Front Page. The delay in the redirect (setTimeout) and the high priority of the action were exactly what was needed to bypass the conflict with the other scripts.

I really appreciate the professional support and for taking the time to log in and fix it directly. You can close this ticket now.

Best regards!

Hello

Thank you and Welcome :)