I know how to add extra fields to the store side panel but would like to add a phone number and hours to the marker popup only. How do I do this? When I add fields to the geoJSONfeed description via global: custom_text, which is: [gsl_addressfield]
[field_store_locator_phone]
[field_store_locator_office_hours], it shows up in the store side panel but not the marker popup. The marker popup, repeats the store address twice. I would like the address on top and the phone/hours below in the "features" area of the marker.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

michfuer’s picture

Currently adding fields to the marker popup is not supported through the admin UI. They're added through the 'props' parameter of the storeLocator.Store objects which are created in the google_store_locator.js file. This issue is coming up enough though that I think we should seriously consider adding it as a feature. You can read more about the storeLocator.Store class here

adster13’s picture

Would love for this to be implemented so I can add store opening hours only to the map popup.

ranbirp’s picture

Hi

@michfuer

Sorry, I was looking through the file and couldn't see where to add this data, could you advise please?

Thanks

prezaeis’s picture

ditto

prezaeis’s picture

any news on this?

michfuer’s picture

Checkout my comment to adster13's question on the Drupal Commerce Blog.

Currently this will take a good bit of customization. I have on my 'To Do list for future versions' to just add the most widely used properties (e.g. phone number, website) as fields on the 'Store Location' content type, and then they would still be added both to the infoWindow and the panel element.

Dictating which element (infoWindow or panel) the property gets added to is going to be difficult to add as something you can configure via the admin UI.

RKS’s picture

@michfuer

I think you would be best served adding generic fields and allow the user to label them when creating the content-type. Otherwise, you'll cover phone number, website, etc and then a month later start getting duplicate issues like, "But what if I want to add [different] field to my map box?" And then this will start all over.

michfuer’s picture

Status: Active » Closed (fixed)

@RKS: I hear you with the generic fields, the only issue is that currently the library only supports the following store properties: 'title', 'address', 'phone', 'web', and 'misc'.

The good news is that the 'misc' property can be the default goto field when somebody wants to add a unique property.

Checkout the latest dev version to see the changes I've made. Now Store Location should have a phone, web, and misc. fields. Make sure to run update.php to get them.

RKS’s picture

Yeah I guess you would be limited to what Google will let you do. I wasn't considering that. But I think a misc field will be better than nothing at least.

endless_wander’s picture

FileSize
139.15 KB

I approached this from the Views angle and was able to add fields to my display through the Location Export view that this module creates.

For example, I added "Phone Number" and "Website" fields to my content type. Then, I added these fields to the Location Export view, excluding them from display. (First, I made a clone of the Location Export view as a backup.)

Then, I used the "Rewrite Results" option in the View for the Address field and rewrote it like this:

<div class="locator-address">
[gsl_addressfield-thoroughfare]
<br/>
[gsl_addressfield-locality], [gsl_addressfield-administrative_area], [gsl_addressfield-postal_code]
</div>
<span class="locator-phone">[field_phone_number]</span>
<span class="locator-website">[field_website]</span>

The markup is just so I can style things as I wish, although you can use CSS to display:none anything you don't want to appear in either the address lists or the map popups.

Attached is a screenshot of how this looks for me. If anyone knows of any reason why messing with the view is a no-no, let me know. Far as I can tell, as long as the coordinates aren't tampered with, the map and locations work great.

jalves’s picture

#10 works for me too!
Thank you!

promarka’s picture

Issue summary: View changes
FileSize
125.7 KB

#10 works
I used the "Rewrite Results" option in the View for the gsl_feature_filter_list. The result is the result is attached.
Thank you!

brayo4’s picture

</code>Greetings,

I am unable to get the feature filter list to display on the side panel or the pop up. is this feature natively enabled at install or is some hack needed? i followed the install notes carefully and the address is displayed but not the additional features, i.e website, phone etc..... thx in advance.

Location Export

<code>{
  "type" : "FeatureCollection",
  "features" : [
    {
      "type" : "Feature",
      "geometry" : {
        "type" : "Point",
        "coordinates" : [
          xx.xxxxxx,
          -x.xxxxxx
        ]
      },
      "properties" : {
        "name" : "Google Store Name",
        "description" : "<div class=\"street-block\"><div class=\"premise\" x-autocompletetype=\"address-line2\" autocomplete=\"address-line2\">Down Town Rd</div></div><div class=\"addressfield-container-inline locality-block country-NZ\"><span class=\"postal-code\" x-autocompletetype=\"postal-code\" autocomplete=\"postal-code\">00100</span> <span class=\"locality\" x-autocompletetype=\"locality\" autocomplete=\"locality\">Christchurch</span></div><span class=\"country\" x-autocompletetype=\"country\" autocomplete=\"country\">Nz</span>",
        "gsl_feature_filter_list" : "Open M-F 0800-1700",
        "gsl_props_misc" : always open for business,
        "gsl_props_phone" : xxx178987,
        "gsl_props_web" : www.riscky.com,
        "nid" : 16
      }
    }