Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterGreat! That indicates a possible bug here as the empty phrase should actually work, you did everything correctly 🙂
I think it’s only related when using in combination with Elementor Loop Grid, I will make sure to investigate this further.
Ernest Marcinko
KeymasterHi,
I think the parameters might be trimmed off due to the empty search phrase, but I’m not 100% sure. Can you please try changing the options, so that the search phrase is one space character: https://i.imgur.com/rcvabzg.png
That should trigger a refresh with the correct parameters. Let me know!
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterIndeed. To resolve this, I have added an additional container in the theme search.php file, so that the results are properly isolated: https://i.imgur.com/cFUX9BM.png
After that, I have added the selector to the live search feature, now it should be much better.Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
It is possible to restrict the results to the current category of the page via this custom code snippet.
However in your case it may be a bit more complicated as using the category shortcode does not indicate which category the page is in – they are not connected in any way. To do that, you would have to create a programmatical map (array) of pages and product categories it should restrict. I’m thinking using this example as the base.
Here is a super simple custom code that should do the trick. You want to change the $page_rules variable, you can add as many lines as you want. On the left side is the page ID, on the right side is the category ID to which you want to restrict the search results to on that given page.
add_filter( 'asp_query_args', 'asp_include_only_term_ids', 10, 2 ); function asp_include_only_term_ids( $args, $id ) { /** * Format: page_id => product category it should be restricted to * For example, if you want to restrict page ID 123 to category ID 5: 123 => 5, * You can add as many lines as you want */ $page_rules = array( 123 => '5', 456 => '6', ); // -- !! Do not change anything below this line !! -- if ( !is_array($args['post_tax_filter']) ) { $args['post_tax_filter'] = array(); } foreach ( $page_rules as $page_id => $term_string ) { if ( $page_id !== intval($args['_page_id']) ) { continue; } $terms = explode(',', $term_string); foreach ( $terms as $tk => &$tv ) { $tv = trim($tv); } $args['post_tax_filter'][] = array( 'taxonomy' => 'product_cat', 'include' => $terms, 'allow_empty' => false, ); } return $args; }I’m more than happy to help, but please note that this level of customization is beyond support, so I can’t guarantee anything. If you want professional customizations, I recommend our affiliates at wpkraken.
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterOn our demo site we are running on 64MB, that is the WordPress minimum requirement, that should be more than enough.
The actual search plugin peak memory usage in our case is on average is below 0.25MB, based on ~40000 logged queries recently. So 1MB in theory is enough for the plugin, but it’s more complicated than that.
The actual full ajax request memory usage depends on your whole system setup and the overhead, which is beyond the search itself. It’s similar when a page is opened, WordPress needs to load it’s core, plugins etc.. – and the more plugins there are, the more overhead it generates, as the plugins may execute additional code etc.. You need to adjust that according to your exact setup.
I generally recommend minimizing plugins amounts as much as possible, and making sure to use plugins which are high quality and does not load unneccessarily and generate less overhead. That unfortunately does not correlate with plugin popularity, I have seen very popular plugins loading all of their resources for no reason everywhere, slowing down the whole environment.
Also make sure to check the performance optimization guide to get the best out of the search.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi!
Thank you. I have made a new temporary plugin build, which should address this error. I’m attaching it to this reply. Please download and install it. After that the issue should go away. If any other errors pop-up afterwards, please let me know!
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou are welcome!
The issue was caused because Ajax Search Lite was still activated. I have deactivated it, now it should be all right.
Ernest Marcinko
KeymasterHi,
If you are using a very old version (pre 4.26), please update manually first, then after that it should start working again 🙂
-
AuthorPosts