Skip Navigation

[Resolved] How to Change Office Address?

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to add an address field to the Office post type in the real estate reference site, and use that address to plot the office on a map.

Solution:
- Go to Toolset > Post Fields and edit the "Property Details - Office" field group.
- Click "Add new field" and choose an Address field. Name the field "office address" or something similar, insert the field, and save the Field Group.
- Go to Offices > All items, click to edit the Office called "Small Office", and see the new address field in the editor area. You will see a notification here that says "You need a Google Maps API key to use Toolset Maps address fields. Find more information in our documentation." In order to see a map, you must supply your own Google Maps API key as described here: https://toolset.com/documentation/user-guides/display-on-google-maps/
- Next you must add this field to your Office CRED form so that users can set the address field on the front-end forms. Go to Toolset > Post Forms and edit "Add Office" form. Place your cursor in the form contents where you would like the address field to appear, then click the "Add Post Fields" button. You will find your new office address field in the "Custom Fields" section. Click to add the field, then save your form.
- Finally you may wish to add the field to the Layout used to display Offices, the Single Property Layout.

Relevant Documentation: https://toolset.com/documentation/user-guides/display-on-google-maps/

This support ticket is created 7 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by Noriko Sugiura 7 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#540906

I am trying to: figure out how to edit the map address of an office

I visited this URL: lorezosan-realestate.discover-wp.com

I expected to see: an address property that I can edit in "Property Details - Office" or in the Office taxonomy.

Instead, I got: nothing.

What I am trying to achieve: I have created a CRED office add and edit form successfully but would also like to have the user input/amend the office address/location, so that it appears on the map.

#541162

Hi,
The Office post type in the Real Estate reference site is linked to a City, which is used to place the map marker for each Office on the map. However, this functionality isn't hooked into the CRED form so it's a bit confusing. If you want to associate an Office with a City, I can help you add that to your CRED form. However, it sounds like you want to give users the ability to specify an actual address. To accomplish this, you must add an Address custom field to your Office post type. I can help you with this too. Here are some details about how to accomplish that:
- Go to Toolset > Post Fields and edit the "Property Details - Office" field group.
- Click "Add new field" and choose an Address field. Name the field "office address" or something similar, insert the field, and save the Field Group.
- Go to Offices > All items, click to edit the Office called "Small Office", and see the new address field in the editor area. You will see a notification here that says "You need a Google Maps API key to use Toolset Maps address fields. Find more information in our documentation." In order to see a map, you must supply your own Google Maps API key as described here: https://toolset.com/documentation/user-guides/display-on-google-maps/
- Next you must add this field to your Office CRED form so that users can set the address field on the front-end forms. Go to Toolset > Post Forms and edit "Add Office" form. Place your cursor in the form contents where you would like the address field to appear, then click the "Add Post Fields" button. You will find your new office address field in the "Custom Fields" section. Click to add the field, then save your form.
- Finally you may wish to add the field to the Layout used to display Offices, the Single Property Layout.

Let me know if you are able to perform these steps, then we can proceed.

#542776
1.png
2.png
3.png
4.png
5.png
6.png

Hi Christian,

Thank you for the all detailed information. I was indeed getting crazy trying to figure out where the address was coming from. I had guessed it was from the city name, but I changed the city name and the map was still pointing to the same location.

Anyways, I have managed to create the API key, and amended both the Add and Edit post forms. However, I am still facing the following problems:

1) Although maps work fine in add/edit forms, I see some "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT" error in the console (see attachments, including Google API).

2) I have followed the instructions, but I am not able to see the newly added marker as per my custom address field "office-address" in the "Single - Property" view. Map shows empty in the middle of the ocean. However, if I restore the name of the field to the original "wpcf-property-location", map shows the original city (see attachments).

If needed, I can grant you access to my site to take a look.

Thank you so much

#543014

Hi, nice work so far.
I see some "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT" error
Usually an ERR_BLOCKED_BY_CLIENT error indicates you have a browser extension that is blocking some required files. Please try to disable your ad blockers and any other extensions, then review again. If the issue is not resolved, open a separate ticket so we can investigate this issue.

However, if I restore the name of the field to the original "wpcf-property-location", map shows the original city
This would seem to indicate that the issue is related to your office property field. Please check the slug of this field and ensure there are no typo errors, like "-" instead of "_". Then edit the post created by this CRED form. Is the office address saved correctly there? If not, that would indicate the CRED form did not send the address information along correctly. If there were JavaScript errors related to your Ad Blocker, this could be part of the problem, but I would need to investigate further. I will enable private reply fields here, so you can share login credentials if none of these steps help resolve the issue.

#543258
Screen Shot 2017-06-29 at 7.45.02 PM.png
Screen Shot 2017-06-29 at 7.41.56 PM.png

All your View code looks good now, but there is a problem with your site's Google Maps API key. Is it restricted to a specific URL? When I replace your key with my own unrestricted key, maps and markers work correctly. I'm attaching a screenshot of this.

I recommend generating a new API key, or modifying this key to work on your site's domain. I'm attaching a screenshot of the Google API Console. This is where you can modify existing keys. You may need to remove certain restrictions here to make your key work on this site. If you need help generating or managing your Google API keys, you may need to contact their support team.

#543269

Hi Chris,

You were so right also this time. The problem was indeed with my API Key. I had it restricted to the site URL, but I had forgotten to add a * after the url (i.e. *mysite.com/*).

Thank you so so much and so sorry for wasting your time for a problem not related to Toolset 🙁

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.