Post by American » Thu Mar 07, 2013 4:27 am

Temp solution below.

---

Searched but haven't found one in Extensions. Looking to integrate a Google world map of city locations where we have shipped products. Just want City, don't want to pinpoint street addresses. I ship some items to some pretty far off places and thought it would be fun to show.

Just want to pass the city/state/country from the db from customers who have actually purchased something to a Google Map that I can embed in a custom page within the store. Simple as that.

It would be nice if I could specify the type of location marker I want... with an image of some sort but default 'pins' would be ok too.

Anyone know of anything?
Last edited by American on Sun Jun 09, 2013 11:32 am, edited 3 times in total.

Brad G
Granbury, Texas
OC 1.5.6.4


User avatar
New member

Posts

Joined
Fri May 21, 2010 7:39 am
Location - Fort Worth, Texas

Post by American » Sun Jun 09, 2013 5:06 am

Would still like to find a solution to this.

Brad G
Granbury, Texas
OC 1.5.6.4


User avatar
New member

Posts

Joined
Fri May 21, 2010 7:39 am
Location - Fort Worth, Texas

Post by American » Sun Jun 09, 2013 11:17 am

This needs to be more automated but here is a short term solution that works pretty well.

1. Download and install the free Customer Export to CSV plug in to your OC store: http://www.opencart.com/index.php?route ... on_id=4924

2. Export your customers to a CSV file and open in Excel or OpenOffice. Copy and paste four columns in to a new file:
City
County (wrong heading, should be State)
Postcode (changed mine to Zip Code)
Country (you may notice in the screen shot below I used country codes, US, PR, etc but I was toying with some other kmz conversion programs that required it).

In the new file (save it as an xls, xlsx or csv) you need to clean up any empty lines or data that found it's way in to the wrong cell.

3. You will need to have a Gmail/Google account for this and be logged in. Go to https://mapsengine.google.com and create a new map. Name the map and enter a description then import your xls file (it says csv or xlsx but an plain xls is fine) and go from there.

Once the map is created you may need to click on the Data link in the white box and straighten out any data cells that aren't working right.. noted with red and red icon. I found that you can delete that data and move to another cell, then back to the affected cell and type it in and all is well. Not sure why.

After the map is working how you want.. play with icons, etc. Then click on the open folder icon and select Embed on my site. This will give you some iframe code, copy and paste.

4. Go to your OC and go to Catalog>Information, insert a new page, call it whatever.. Customer Map. Enter some descriptive text.. "This is a map of where we have shipped..." then click on the Source button and paste your iframe code, go to your Data tab and make sure it's enabled, shows where you want and set the order, then save.

You should now have a page with your map showing. Iframe sets the map width at 640, I changed it to 800 to work with the default OC theme and a right column.. adjust to your liking.

You can create a page/nav menu wherever you want, the iframe code should work just about anywhere.

In the text above the map I also added a link to the big map, you have to Share it first and make it public then copy the link it offers.

One point.. and maybe Google's MapEngine is beta so it has a few bugs. You can't get rid of the big white box, not a problem on the full MapEngine site but cramps the OC page a bit. The shared link needs to be altered as well:

(not real links)

Code: Select all

https://mapsengine.google.com/map/edit?mid=zDnQXLN4giVY.k1z_k
needs to be:

Code: Select all

https://mapsengine.google.com/map/view?mid=zDnQXLN4giVY.k1z_k
Not that they would have permission to edit your map but sometimes the link would resolve itself on it's own, sometimes it wouldn't unless you fix that.

Obviously you would need to update your customer list from time to time manually on the MapsEngine site for your map but it only takes a few minutes. It would be far better if someone could maybe take some of this and create an automated plugin of some sort or variation.

But this will work for now.

Attachments

2013-06-08 21_46_35-Customer Map.png

OC page with iframe map. - 2013-06-08 21_46_35-Customer Map.png (202.59 KiB) Viewed 2115 times

2013-06-08 21_45_37-U.S. Off Road Customer Map.png

MapsEngine map after import - 2013-06-08 21_45_37-U.S. Off Road Customer Map.png (345.56 KiB) Viewed 2115 times

2013-06-08 21_54_42-city-state-country.xls - OpenOffice.org Calc.png

xls, xlsx or csv file needed to import - 2013-06-08 21_54_42-city-state-country.xls - OpenOffice.org Calc.png (11.54 KiB) Viewed 2115 times


Brad G
Granbury, Texas
OC 1.5.6.4


User avatar
New member

Posts

Joined
Fri May 21, 2010 7:39 am
Location - Fort Worth, Texas
Who is online

Users browsing this forum: No registered users and 45 guests