Disabling Live Search while Typing also disables auto suggest phrase click.

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Disabling Live Search while Typing also disables auto suggest phrase click.

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 year, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33282
    jsamal29
    jsamal29
    Participant

    Hi Ernest,

    As per the ASP documentation, In order to increase performance, I am disabling the “Trigger Live Search when Typing” https://imgur.com/a/95gC2dX and allowing the results to be displaying Only after pressing the Enter key.

    Now the performance seems to be little improved, But now, while clicking on the Auto-suggested phrases (in case of No results found, it displays some suggested words). Clicking on any of those words does not do anything. https://imgur.com/a/EopAxYZ
    Am I missing any settings for this. Please suggest.

    Thanks

    #33292
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    In that case, the keyword should be only filled to the input field, but it will not trigger the search or anything. Does it not fill the search input field either?

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #33299
    jsamal29
    jsamal29
    Participant

    Hi,

    Yes..it is filling the search in Textbox. https://imgur.com/a/mAumZs3 …. but please tell me how to trigger the search on clicking on those phrases.

    Thanks

    #33312
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Well, the only way is using a custom code. Try adding this code 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', 'wp_footer_asp_trigger_on_suggest');
    function wp_footer_asp_trigger_on_suggest() {
    	?>
    	<script>
    	jQuery(function($) {
    		$('body div').on('click', '.asp_keyword', function(){
    			console.log('on');
    			ASP.api(
    				$(this).closest('.asp_r').data('id'), 
    				$(this).closest('.asp_r').data('instance'),
    				'searchRedirect',
    				$(this).text()
    			);
    		});
    	});
    	</script>
    	<?php
    }

    Unfortunately I can not guarantee this is going to work in all cases.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.