Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Ajax search pro custom fields problem
This topic contains 23 replies, has 2 voices, and was last updated by Ernest Marcinko 5 years, 2 months ago.
- AuthorPosts
- May 28, 2019 at 9:42 am #22901
AnonymousHello,
Im having some issues with your product.
On the first atachment that post was added from frontend and ive cheched the custom field ive added come from ACF custom fields and they work fine in page but not on the plugin. For example the want_to_rent title which is covered with blue isnt shoving the Label like ive made it to but shoving the value.
The 2nd and third attachment you can see the custom fields that ive just added in ACF and checked them from that plugin but they are showing fine, only on ASPro are stuck and wont show,. Also the fields added in the page cars or shortcode cars they dont react, dont show the search what you click to be show. With one word it doesnt react at any way. And there are two screenshots, sorry for this.
Thanks ArmendMay 28, 2019 at 12:39 pm #22912Hi,
Thank you. The issue with the values was caused by inconsistent data. I have saved the post, to refresh the database, and now it shows up correctly. The field was probably not registered properly yet.
You can still enter the field name, even if the plugin does not find it within the meta table. It usually happens, when the field is not in use yet, but it will still work.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 28, 2019 at 6:02 pm #22919
AnonymousI tried to add another post to show that the plugin is not reading the custom fields well and the search isnt functioning at all. Of course when updating the post and refreshing the database it shows them maybe how it should be but it should work they way it is supposed to work, not refreshing all time the page.
The post colums are not showing three they way they are supposed to be showing.
The search setting do not read the custom fields.
Check the screenshot below.
Thanks ArmendMay 29, 2019 at 8:04 am #22927Hi,
How did you add the post? Was it imported or added manually? When I save the post it functions correctly. The custom field values are requested via the ACF get_field(..) request, so they have to be correct, if correctly stored.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 30, 2019 at 9:29 am #22956
AnonymousHi,
Please feel free to click on the post icon which is showing only the value to ajax and you will see the single post with elementor has recieved all the custom fields on the right way. Only the ajax search pro and you can see it clearly in the page “Cars” even on search custom fields are not functioning, just the “Make” is functioning. Location, Traction, Transmission, Price, Fuel type and the others following are not functioning even though i added them all the right way.
You can go to “auto” post and chech the ajax search pro test and you will see elementor shows them right only this plugin does not.
Reg. ArmendMay 30, 2019 at 11:33 am #22959Hi,
Can you please check the FTP details? I tried to log-in to debug the code, but either the username or the password is incorrect. Let me know if I need any special configuration.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 30, 2019 at 12:20 pm #22960
AnonymousYou cannot access this content.May 30, 2019 at 3:52 pm #22961Thank you, that worked.
Okay, so I did quite long debugging session, and the get_field() ACF api functions simply does not return the correct values as it should for some reason. I honestly don’t know why. I also tried different approaches, to get all the select elements and to find them that way, but they are simply not returned, only some of them. I googled around this issue, but there is no information about this whatsoever. Someone else had a similar issue mentioned on a stack overflow, but it was never resolved either.
Best,
I will try again tomorrow, but honestly this seems like some sort of ACF related issue as well.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 30, 2019 at 4:34 pm #22962
AnonymousI apologize in advance if i made you trouble for no reason, i also contacted the ACF support and they are also checking it. So i didnt had no choice just to write to you and acf together.
Thanks for understanding.
Let me knoe if you find something then.May 31, 2019 at 10:14 am #22973No problem. I hope they might find something. I migth be missing something somewhere, in case I need to fix it 🙂
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 3, 2019 at 11:20 am #22994
AnonymousHi there,
Any update?June 3, 2019 at 1:35 pm #23002Hi,
Unfortunately I was not able to make any progress, I could not find any more information on why the values are not returned correctly 🙁
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 3, 2019 at 1:40 pm #23005
AnonymousSo that was it ? Any idead what to do now?
June 3, 2019 at 2:13 pm #23007Well, all I can conclude is that the ACF get_field(..) is not returning the correct values for some reason – and the problem is, that I could not find any conflicts. We should wait for response from the ACF team, as they know their product better. Please let me know if you get any response. I also looked through almost all past tickets that is related to ACF, but there was no similar issue to this, which is very weird.
If you want, you can pass this message to the ACF team:
NOTE: The issue below is within an ajax context, also, not within a posts loop. (call to the wp-admin/admin-ajax.php file)
Best,
I have tried getting the post meta value (drop-down type), via the ACF API get_field function, like so:
$value = get_field('field_name', $post_id);
..however, the value returned was always the drop-down value, and not the label. Then, to resolve the key -> value pairs, I tried getting the field object choices, like so:
$fo = get_field_object('field_name');
..however, the $fo[‘choices’] did not contain the choices in every case, as it should. In this case, it returned correctly for the Transmition field, however not for the Fuel Type – which is very weird, as both fields are drop-down type.
Then, I also tried getting the choices via parsing the
$GLOBALS['acf_register_field_group']
..global variable, however that did not contain the choices either.
As a last resort, I also tried getting the choices via using the field key within the get_field_object(..) call, but that did not make any difference either.
Any help on this issue would be greatly appreciated. Thank you!
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 5, 2019 at 1:12 pm #23044
AnonymousHello again,
They were searching in the website for issued and they could not find anything.
They got this excuse now that it is working they way it should be while the checked from the frontend and backend.
If you click on a post on http://www.searchcut.co.uk/cars/ in any post you see that the fields are filled all right.
The only this might be ajax is not getting the fields somehow. I wrote back to them to give any help for you but they havrnt answered back.
Thank, Armend - AuthorPosts
You must be logged in to reply to this topic.