Location Region
This topic contains 21 replies, has 4 voices, and was last updated by Stiofan O’Connor 7 years, 6 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
August 31, 2017 at 8:02 am #393687
Hi – I can’t seem to find the answer in the documentation of forums but have a query on the location region data. Does this have to be validated by the Google API? For example, using coordinates 55.9576692,-3.1992202, I can see that the info returned from the Google API is
http://maps.googleapis.com/maps/api/geocode/json?latlng=55.9576692,-3.1992202&sensor=false“long_name” : “Edinburgh”,
“short_name” : “Edinburgh”,
“types” : [ “postal_town” ]
},
{
“long_name” : “Edinburgh”,
“short_name” : “Edinburgh”,
“types” : [ “administrative_area_level_2”, “political” ]
},
{
“long_name” : “Scotland”,
“short_name” : “Scotland”,
“types” : [ “administrative_area_level_1”, “political” ]
},So the location region is ‘Edinburgh’, the same as the city. Can this be changed to ‘Edinburgh & Lothians’ or will GeoDirectory need to use the values returned by the Google API?
Thanks!
August 31, 2017 at 9:46 am #393716Hi David,
There is no real definitive “region” list of Scotland, we usually just go with what Google decides to return but there are ways to override things. Will your directory be limited to just Edinburgh or Scotland, or what? (maybe we need to override more)
Thanks,
Stiofan
August 31, 2017 at 11:27 am #393730Hi – these are the regions I want to represent below. Just now I’m setting things up with a single location but realise I’ll need to purchase the add-on to have multi location directories. The directory is mainly Scotland, but North East England also.
ABERDEEN & NORTHEAST SCOTLAND
AYRSHIRE & ARRAN
BORDERS
DUMFRIES & GALLOWAY
DUNDEE & ANGUS
EDINBURGH & LOTHIANS
FIFE
GLASGOW & GREATER GLASGOW
HIGHLANDS & ISLANDS
PERTHSHIRE
STIRLINGSHIRE & CLACKMANNANSHIRE
NORTHEAST ENGLANDAugust 31, 2017 at 12:38 pm #393745OK thanks,
Not tested but something like this should do what you want.
add_action(‘geodir_add_listing_geocode_js_vars’,’_my_region_name_changes’,20);
function _my_region_name_changes(){ echo "if(getState=='Edinburgh'){getState = 'Edinburgh & Lothians';}"; }
I would recommend adding the “code snippets” plugin to add the code, if you have any problems you can provide wp-admin details in a private reply (only staff can see) and i will take a look.
You would also have to manually change the default location region to the exact text, the & might cause problems, if it does you might have to use “and” or a dash or slash.
Thanks,
Stiofan
August 31, 2017 at 1:32 pm #393758Thanks! I’ll give this a go and let you know how it goes.
September 1, 2017 at 5:58 am #393892Hi – I’ve tried this, but doesn’t seem to work for me – could you take a quick look? I can’t seem to change the default location, as when I type in ‘Edinburgh & Lothians’, the label reverts back to ‘Edinburgh’. Can you let me know an email address and I’ll set up an admin account?
September 1, 2017 at 10:46 am #393917hi david, u can us any email or ([email protected]) for the admin account, please post the username/pass here in a private reply and i will take a look.
Thanks,
Stiofan
September 4, 2017 at 5:49 am #394144This reply has been marked as private.September 4, 2017 at 6:23 pm #394251Hi,
please don’t send us emails:
post the username/pass here in a private reply and i will take a look.
Thanks
September 4, 2017 at 7:14 pm #394257This reply has been marked as private.September 5, 2017 at 5:53 am #394302Hi David,
You have used incorrect single quote in code snippet. I have modified snippet.
Currently your site has no Multilocations installed so you can use directly set “Edinburgh & Lothians” at GeoDirectory > Set Default Location > Region.
If you want to install Multilocations then the code snippet will work fine with Multilocations as well, i have tested in my test site.Thanks,
KiranSeptember 5, 2017 at 6:54 am #394311Thank you!
September 20, 2017 at 12:58 pm #396581Hi – I’ve tried to add in some more places that are to be part of the ‘Edinburgh & Lothians’ region, but these are not being added to the map and places posts. They have a different ‘city’ but are still part of ‘Edinburgh & Lothians’ – should this work, or for those places to be part of the same location, do they need to be the same city? I want to have ‘Edinburgh & Lothians’ covering galleries in Edinburgh, East Lothian and West Lothian.
Thanks,
David
September 20, 2017 at 1:04 pm #396584Also, is it possible to get an error log of the failed imports? I have:
Total 83 item(s) found.
69 / 83 item(s) added.
12 / 83 item(s) could not be added due to blank/invalid address(city, region, country, latitude, longitude).
4 / 83 item(s) could not be added due to blank title/invalid post type/invalid characters used in data.
Please transfer all images in ‘wp-content/uploads/2017/09’ folder.but would be good to get the exact errors. I can export and compare, but I still then need to work out the exact problem of the failed records.
September 20, 2017 at 1:13 pm #396589Hi David,
If you have WP_DEBUG enabled in wp-config.php then it logs errors for listings which are not imported.
Add following line in wp-config.phpdefine('WP_DEBUG', true); define('WP_DEBUG_LOG', true);
Let us know if you have any problem.
Kiran
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket