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

Get text parameter search from form in 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.

Hi, I'm trying to have a form in the header of my site where if I insert a text and submit the form I got the shop page with the results of the query and the filters enabled.

If I try to change page when the filter reload the page I get a different amount of products. Am I missing something?

Practical example: https://www.intinijewels.com/. On the top-left enter"agate necklace" in the form and submit it. I'm redirected to a page where i see there are only 29 results. If I press on the pagination on the second page, I get 241 results after the ajax update.

Am I missing something? This is the code of the form in the top-left

<form role="search" method="get" action="<?php echo home_url( '/' ); ?>">
<input type="text" autocomplete="off" value="<?php echo $_GET['woof_text'] ?? '' ?>" name="woof_text" placeholder="<?php _e( 'Search for a product', 'coriweb' ); ?>" />
<i class="fal fa-search trigger-submit icon <?php echo empty($_GET['woof_text']) ? 'disabled' : ''; ?>"></i>
<div class="d-none">
<input type="hidden" name="post_type" value="product" />
<input type="hidden" name="swoof" value="1" />
</div>
</form>

Hello

Please  paste your license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png

Activate  this extension - https://share.pluginus.net/image/i20210923123525.png

And  use this - https://products-filter.com/shortcode/woof_text_filter

I tried that filter but it doesn't redirect. If i put that shortcode on a page that is not shop or category it doesn't redirect to shop page.

Another problem is that if I enable text search on the shop page and i search"agate necklace" I get all products with the word"agate" or the word"necklace" and I want only the products with both words like if i'm using the standard wordpress search. This is the result i got with the form I created if I insert agate necklace: https://www.intinijewels.com/?woof_text=agate+necklace&post_type=product&swoof=1 In this example I see only the products with both the words searching in title and content

Hello

I tried that filter but it doesn't redirect. - Please  try  to  use [woof by_only='by_text' tax_only='none' redirect='your_link' ]

Add  code  in functions.php

add_filter('woof_text_search_like_option', function($do){

return  true;

});

 

Hi Pablo, so sorry but the fix you seggested me doesn't work. I recreated the site in a demo environment and I wrote ftp and admin access in the private data.

This is the homepage of the demo site: https://intini.tmp01linuxsp.coriweb.it/

I put the shortcode you suggested me in the header.php on line 63 (I will fix css later): <?php echo do_shortcode("[woof by_only='by_text' tax_only='none' redirect='https://intini.tmp01linuxsp.coriweb.it/shop/' ]"); ?> but if I try to write agate necklace and press enter I will not be redirected to shop page. I expect to go to shop page with the pre-set text filter.

If I go to the shop page directly and insert the filter directly on the page I keep getting different results from the standard search page. If on the shop page (https://intini.tmp01linuxsp.coriweb.it/shop/) I enter in the text filter"agate necklace" I get 106 results (I have fewer products on the test site) meanwhile on the stanard search page with the same query (https://intini.tmp01linuxsp.coriweb.it/?s=agate+necklace) I get 51 results.

I already put the filter in functions.php on line 720

add_filter('woof_text_search_like_option', function($do){

return  true;

});

If I change the behavior of the text search (https://intini.tmp01linuxsp.coriweb.it/wp-admin/admin.php?page=wc-settings&tab=woof) I always get 106 results.

To clarify, I would like the search to show products that have both words (either in the title or in the content or both). Currently it shows me all the products that have either one word or the other. Even if I change the settings from the backend, the result doesn't change

Hello

Please  disable  turbo mode and  do a test

Hi Pablo, I tried online! Now is perfect! Such a pity we can't use turbo mode but now it's perfect!!!!

Thank you

Great!  Welcome;)