VANTAGE map-import-fix
Hi,
VANTAGE's import function will not show map if the listing doesn't have the lng and lat coordinates. They have implemented a fix that will get the coordinates automatically when you edit the list. That's ok, if you don't have to many listings to import. You'll have to edit them one-by-one.
If you have hundreds or thousands of listings to import, there's a better ways. You can either find those coordinates on the net and paste them to your listings in the csv file, or have my vantage map-import-fix get it automatically during the import. This is how you implement it:
Include the following code at around line 328 as shown in the video
here
Code:
// START MY CODE
$base_url = 'http://maps.google.com/maps/geo?output=json';
$address = $row['address'];
if ( !empty( $address ) ) {
$response = wp_remote_get( add_query_arg( 'q', urlencode( $address ), $base_url ) );
if ( 200 == wp_remote_retrieve_response_code( $response ) ) {
$results = json_decode( wp_remote_retrieve_body( $response ), true );
if ( $results ) {
list( $lng, $lat ) = $results['Placemark'][0]['Point']['coordinates'];
appthemes_set_coordinates( $post_id, str_replace(',','.',$lat), str_replace(',','.',$lng) );
}
}
}
//END MY CODE
Don't forget to say thx by clicking the THX link below to the left....xD Appreciate it!