This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Ajax Search No Longer Retreiving Data

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Ajax Search No Longer Retreiving Data

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #53422
    adw259adw259
    Participant

    I am using Ajax Search Pro on Dazed.fun and they updated a plugin called LeafBridge which is basically their ecommerce system. Problem is that now Ajax Search is no longer working since they made some change with the post type and the way the plugin ‘exposes’ it’s data to Ajax Search. I got a short video that the plugin developer created that could help fix the issue. Can you please take a quick look within my site admin panel please. He says that the issue is easy to fix but he only used Ajax Search Lite on a demo site with his updated LeafBridge plugin. On my live site that has Ajax Search Pro his recommended fix is not working.
    ~Alex

    WP FTP is already installed. Feel fee to do whatever you want, as this is just a staging site.
    ————–
    Message below is from Nick at LeafBridge ([email protected])…

    Here’s a quick video on Loom outlining what we’d need to display thumbnails in the search bar results: https://www.loom.com/share/4e7dd63c11dd418fb68febf9e675b646


    @Alex
    you should be able to send that on to the developer you worked with for more info.

    Alternatively we do plan on adding this as a standard function in our roadmap but I don’t currently have a timeline on that.

    I hope that helps and please let me know if you have any questions!

    Thanks,

    #53441
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Thanks for the details!

    I have added the following custom code to fetch the images for you:

    add_filter('asp_results', function($results){
    	foreach ($results as &$r) {
    		if ( $r->post_type !== 'product' ) continue;
    		$schema = get_post_meta($r->id, 'lb_product_schema', true);
    		$data = json_decode($schema, true);
    		$r->image = isset($data['image'][0]) ? $data['image'][0] : $r->image;
    	}
    	return $results;
    });

    There is however one issue unrelated to the plugin. The images source domain have a same-origin policy, so even though they are linked to be displayed, the source domain is prohibiting to display them from anywhere else.

    You may want to look at issue. It’s usually an option somewhere in the image domain CDN or on the apache/ngingx mod_rewrite rules.

    The code above should work just fine, however I can’t guarantee anything as this is a customization.

    #53445
    adw259adw259
    Participant

    Sorry Ernest, I gotta ask, where is the above code because I do not see it in the theme’s functions.php file and also… there are still no search results in the Ajax Search dropdown. See sceenshot from staging site… https://snipboard.io/Hrk5OP.jpg

    Staging site ul… https://ard2i1eeon-staging.onrocket.site/locations/holyoke/

    LM K if I am doing something wrong please?
    ~Alex

    #53446
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Sure! I have added it through the snippets plugin since it was installed.

    I have only tested on the back-end that’s why I didn’t notice, the search is working there. So the issue seems to be a custom field filter, which is set on the front-end by a custom script you have. It adjusts the field with that hash value, which I assume no longer matches the database, but I don’t know what that is.
    From what I can see that custom field _leafbridge_product_single_meta_retailer_id does not exist anymore, so that explains the problem.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.