Error Searching for Product Categories

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Error Searching for Product Categories

This topic contains 5 replies, has 2 voices, and was last updated by

 
Keymaster
1 year, 4 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #29512

    Participant

    When we search for our products like Lipitor, it works great…
    When we search for some Product Categories, it also works OK, like Acne or ADHD

    But other product categories return an error like Blood Pressure or Cholesterol I get:
    “The request failed. Please check your connection! Status: 500”

    can you please help me?

    #29519

    Hi,

    Sure! Can you please add temporary FTP and back-end access? I would like to debug the query. Thank you!

    Best,
    Ernest Marcinko

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


    #29520

    Participant
    You cannot access this content.
    #29526

    Thank you!

    I think I found the issue. On the General Options -> Sources 2 panel, you had some taxonomy terms selected to be returned as results, which I think you didn’t want. You only needed to search the taxonomies and return the products, so I disabled those option. Now it should work all right.

    Best,
    Ernest Marcinko

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


    #29538

    Participant

    Thanks, that removed the error, but also removed a function that we want.

    We also want to be see a “Category” box when the term searched for matches a category

    #29547

    Hi,

    The issue is caused by a custom code. I cannot tell where exactly it is, I could not find it in the child theme directory. It is probably related to something like this:

    add_filter( 'asp_results', 'asp_add_custom_shortcode', 10, 1 );
    function asp_add_custom_shortcode( $results ) {
    	foreach ($results as $k=>&$r) {
    		// Enter the shortcode into the quotes section
    	  	$r->content = do_shortcode('[my_shortoce_here]') . $r->content;
    	}
    
    	return $results;
    }

    I suspect the “do_shortcode” is not working correctly within the terms context. Try modifying the final code to something like:

    add_filter( 'asp_results', 'asp_add_custom_shortcode', 10, 1 );
    function asp_add_custom_shortcode( $results ) {
    	foreach ($results as $k=>&$r) {
    		if ( isset($r->post_type) ) {
    			// Enter the shortcode into the quotes section
    			$r->content = do_shortcode('[my_shortoce_here]') . $r->content;
    		}
    	}
    
    	return $results;
    }
    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.