Creating a Store Locator for Your ocPortal Website

Catalogue field choicesocPortal has a huge number of possibilities available to it with its impressive choice of built in features. On top of the inbuilt features there is also a great range of additional optional features created by both the ocPortal team and other community members. One of these is ocDatamap which makes adding a store locator to your website a simple process. A store locator is very useful for any retail business.

Setting up the catalogue of stores

The first part of this is to set up a catalogue within your install which will include all of the information relating to your stores and the positioning data for each store. To be able to fill in the data you will need to know both the longitude and latitude coordinates of each store. To find this you can use this free website.

I will go through the minimum for creating a new catalogue for your store locator. You can add as many fields to the information as you like but there are too many field option types to cover in this tutorial!

Adding your Store informationCreating your catalogue

  • Navigate to the content section of the adminzone and choose catalogues
  • Choose add catalogue
  • Give the catalogue a name – for this version I have called it “stores” and used the same for the catalogue codename.
  • In the name box for field 1 call it Store name
  • Leave the setting as a brief line of text and to display in category views
  • On field 2 give it the title store information
  • Set field 2 as multiple lines of text either with or without comcode support. This is so you can fill in the information for the store
  • Leave the settings for field 2 as a brief line of text and to display in category views
  • For fields 3 and 4 these are the longitude and latitude fields for your stores. They should have one field for longitude and one for latitude and you probably want to un-tick the options to show on the catalogue list and also for in search.
  • Click add catalogue once you are happy with all of the fields you have added.

You now need to add entries for all of your stores including the latitude and longitude fields

Adding the module to your install and placing the store locator on a page

The next part of the process is installing the addon and placing the block on the relevant page. To do this you need to:

  • Login to the adminzone and navigate to the addons page which is located in the structure section
  • Choose Import Non bundled addons
  • Expand the information display section and choose ocDatamap
  • Click import non-bundled addons
  • Click proceed
  • When you return to the addons screen scroll down to ocDatamap and click the green plus sign to install the addon
  • Click proceed
  • Navigate to the page where you want the store locator to appear

You can either add the block using the block construction assistant in which case you need the block titled “main_google_map” or you can add the block manually in which case the code will look something like:

Store locater box[block title=”store locator” description=”This is a Store Locator” latfield=”latitude” longfield=”longitude” catalogue=”stores” width=”100%” height=”400px” zoom=”6″ latitude=” 53.417436″ longitude -1.358185″]main_google_map[/block]

You can change these options to suit your own Catalogue. The parameters you can add are:

  • Title – the title of the block
  • Description – a description of the block
  • Latfield – This is a required field and must have the same name as the field you have put the latitude coordinates in when creating the catalogue
  • Longfield – This is a required field and must have the same name as the field you have put the longitude coordinates in when creating the catalogue
  • Catalogue – A required field and should be the codename of the catalogue you have created
  • Width – the width of the block, This will default to 100%
  • Height – the height of the box which will default to 300px
  • Zoom – A number between 1 and 17, the higher the number the more zoomed in the map will start at.
  • Latitude – The Latitude coordinates where you want the center of the map to be when first loaded.
  • Longitude – The Longitude coordinates where you want the center of the map to be when first loaded.

You should note that the preview of this page will not work for this block so I recommend creating the page not attached to a live site and making sure it works before you link it to your live site.

If you want, you can  or Follow me on Twitter

Looking for quality ocPortal Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , | Posted under ocPortal | RSS 2.0

Author Spotlight

Steve Jarvis

Hi I'm Steve, I've been using computers in one form or another since i was 5 with a Dragon 64 and building websites since the late 90's. I'm currently employed as a digital marketing person for Planet X Bikes. When not writing blog posts or working i'm a family man (Wife and Daughter) and a PC Gamer

Leave a Reply

Your email address will not be published. Required fields are marked *