The CSV file must be sorted and arranged by the the following fields:
Name : Phone : Street : City : Province : PostalCode : Country : Latitude : Longitude : PreferredStore : Custom Info
The Name field is mandatory field.
Any other fields that are not mandatory can be ignored but the column should exist. For eg: Phone field is not required but the field needs to be left empty '::'
There should be no headings for the columns and no blank rows.
The Latitude and Longitude fields should have 0 for the first row at least.
The List separator need to be ':'. To change the list separator in MS Excel, the following steps need to be followed:
In Microsoft Windows, click the Start button, and then click Control Panel.
Open the Regional and Language Options dialog box.
Do one of the following:
In Window 7, click Regional and Language Options, and then click Customize This Format button.
In Windows Vista, click the Formats tab, and then click Customize this format.
In Windows XP, click the Regional Options tab, and then click Customize.
Type a new separator ':' in the List separator box.
Click OK twice.
Once its done, click on Save As then choose .csv from the File Type drop-down.
For OpenOffice, Check the Edit filter Settings checkbox in the dialog box that appears when Save As is selected. In the Export of Text files dialog box, change the Field Delimiter to ':'.
For sample CSV file, Click Here or download sample from here
';
?>
Get Coordinates for Stores
Clicking on the Get Coordinates button gets the geo-location details for all the stores that do not have a latitude or longitude.
Saving coordinates...
Please wait...
plugins_url('/akw-store-locator')
);
wp_localize_script('addakwadminjsfunctions', 'akwstorelocatoradminobject', $akwStoreLocatorAdminArray);
//Check current version
}
//Function to display store locator in the theme pages
function displayakwstorelocator($attributes)
{
$imageURL = WP_PLUGIN_URL.'/akw-store-locator/images/working.gif';
//Array to declare object with attributes in js file
$akwStoreLocatorArray = array(
'plugin_url' => plugins_url('/akw-store-locator')
);
wp_register_script('add-akw-store-locator-script', plugins_url('/akw-store-locator/js/storeLocatorFunctions.js'));
wp_enqueue_script('add-akw-store-locator-script');
wp_localize_script('add-akw-store-locator-script', 'akwstorelocatorobject', $akwStoreLocatorArray);
wp_enqueue_style('addAKWStoreLocatorCss', plugins_url('/akw-store-locator/css/akw-store-locator-style.css'));
//short code attributes set or replace defaults
$shortCodeAttr = shortcode_atts( array(
'maplabel' => 'Postal/Zip, City/Province/State or Full Address',
'mapbutton' => 'Search Stores',
'storelabel' => 'Store Name(Optional)',
), $attributes);
$output .= '
';
return $output;
}
//Add shortcode for the display function
add_shortcode('akwstorelocator', 'displayakwstorelocator');
//Function to add google api script to the theme header
function addakwstorelocatorscriptstotheme()
{
if(!wp_script_is('googleapis', 'enqueued'))
{
if(USE_GOOGLE_KEY == true)
{
wp_enqueue_script('googleapiurl', 'http://maps.googleapis.com/maps/api/js?key='.GOOGLE_API_KEY.'&sensor=true');
}
else
{
wp_enqueue_script('googleapiurl', 'http://maps.googleapis.com/maps/api/js?sensor=true');
}
wp_enqueue_script('add-akw-google-api');
}
}
//Using action to add the google api
add_action('wp_enqueue_scripts', 'addakwstorelocatorscriptstotheme');
?>