I'm developing a real estate website, that has listings, condominiums, etc.
I've created a custom post type, to the listings and using types, I created another for condominiums.
In this situation, I have a field for the listing address, that was hard-coded.
Since many listings can be on the same condominium, should be great for the brokers to don't fill the listing address everytime they need to add a listing inside a condominium.
My doubt if is possible to retrieve the listing address using jquery, API or something of the kind for the user just press on the button on the panel and the system retrieve the fields that are requested. In this example, the listing address.
There isn't such kind of built-in feature within Toolset Forms + Toolset Maps plugins retrieve the listing address using jquery, API or something of the kind for the user just press on the button on the panel and the system retrieve the fields that are requested
The custom address field is based on Google map API, user can fill partial value into address input box, and Google map API will retrieve some related address, in your case, it needs to retrieve the existed address value from website database.
So it needs custom codes, for example, you can try these:
1) Create a post view:
- query listing posts,
- in view's loop, display the custom address field values as links
2) Setup custom JS codes, when user click address link, fill the specific address value into the address field of your post form.
Thanks for your help and sorry for the delay, I was trying to execute what you suggested.
My fields are inside the wordpress panel, so the listing fields and the condominium fields can be associated on the wordpress panel.
I could do the jQuery button inside the panel, as you concerned, to fill the input inside the panel, but since the wordpress panel, what is very good. The jquery code that I've done is below, and the result on the panel is on attach.
$("#wre-condo").click(function () {
$("#wre-geocomplete").val("[types field='cep' item='@associar-condominio.parent'][/types]");
});
I tried to pull the fields of condominium that is associated with that listing, but the wordpress panel, of course doesn't read shortcodes.
There's a way to use something like that shortcode inside the jQuery, in a way that the wordpress panel can read?
2) When user click one of above link, you can trigger your custom JS function like this:
jQuery(".my-class").click(function (event) {
// here setup your custom codes
var text = jQuery(this).text(); // get address text
jQuery("#wre-geocomplete").val(text); // fill it into address field
});
If there's not a way to get the address from API or front-end, I got an idea here:
In attach, I have the field to associate the condominium to the listing. This field just brings the condominium name. If like an relationship, it bring the address also, I could use the jQuery that you mentioned above to get the address on the same page.
Luo is on vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.
Can you please share problem URL and access details and explain what exactly you want to achieve that will help me to understand your issue as well as to guide you in the right direction.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Thank you for sharing access details but can you please share problem URL and share as much details as you can what exactly you want to achieve with what field? where I should look at?
I have set the next reply to private which means only you and I have access to it.
Sorry for don't providing those details, they are really important, hahaha
Well, since its a listing website, I have the listing (an existing one is in the link: hidden link ). Inside of the fields of this listing, I have the field 'associar condomínio', in English, Associate Condominium. This field its just a searchbox that makes a reference for the other custom post type, `condomínio' In English, condominium. One existing is hidden link and this particular one is related to the listing of the link above.
I just need that this field "Associar condomínio" bring the listing address fields ( slugs: 'cep' and 'endereco') for I use jQuery to fill the fields of the address of the listing, automatically, using the condominium data.
I just need that this field "Associar condomínio" bring the listing address fields ( slugs: 'cep' and 'endereco') for I use jQuery to fill the fields of the address of the listing, automatically, using the condominium data.
==> Do you mean that you want to bring those listing address fields ( slugs: 'cep' and 'endereco') within the admin?
Yes, those fields should appear in the admin. When I make the reference for the condominium in the listing fields, currently it just brings the name of the condominium. If you could bring those two slugs, will be perfect.
What if you try to get those fields on save_post action when you save the post?
-If the fields be filled automatically, when the user clicks on publish, that will be nice!
How do I can use the toolset PHP API to convert this shortcode ([types field='cep' item='@associar-condominio.parent'][/types]), that retrieves a field from a post reference?