- This topic has 1 reply, 2 voices, and was last updated 12 months ago by Ernest Marcinko.
-
AuthorPosts
-
September 18, 2023 at 3:55 am #45407mikemccurdyParticipant
Hi,
We are using a Search for our products.
The URL says SERVICES, but we are actually using WooCommerce products.
And we are almost set.We just want to show our products instantly when they click on the search bar.
I set a minimum character to 0 to trigger the live search.
It works, but not initially.
After I type a space or anything, your live search starts working.
But we want it to show popular products right after they click and then keep changing products when they start to type words. That’s already working.Just need help with triggering live search instantly when they click.
Like this website https://www.taskrabbit.com/
I contacted your presale support. They said it is quite easy with a few lines of custom code after we purchase the paid version.And if you have any way to control or sort the products when they click, please also leave a guide for me.
Thanks in advance
September 18, 2023 at 2:25 pm #45420Ernest MarcinkoKeymasterHi,
Thank you very much for the details! Indeed, this should be doable with a small custom code snippet.
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.
add_action('wp_footer', 'asp_add_footer_script', 99999); function asp_add_footer_script() { ?> <script> jQuery(function($){ $('input.orig').one('click', function(e){ $(this).get(0).dispatchEvent(new Event('input')) }); }); </script> <?php }
If you need help with this just let me know!
-
AuthorPosts
- You must be logged in to reply to this topic.