Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Ajax Search No Longer Retreiving Data
- This topic has 3 replies, 2 voices, and was last updated 1 year, 2 months ago by
Ernest Marcinko.
-
AuthorPosts
-
March 21, 2025 at 3:02 pm #53422
adw259
ParticipantI 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.
~AlexWP 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,
March 23, 2025 at 2:09 pm #53441Ernest Marcinko
KeymasterHi,
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.
March 23, 2025 at 9:59 pm #53445adw259
ParticipantSorry 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?
~AlexMarch 24, 2025 at 8:18 am #53446Ernest Marcinko
KeymasterSure! 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_iddoes not exist anymore, so that explains the problem. -
AuthorPosts
- You must be logged in to reply to this topic.