I want to integrate Google Maps in Products Module, but I don't know how can I do that.
I tried this method in Detail Template of Product Module, but it isn't work:
(I inserted the google API of course, and I tested it. It worked correctly in simple template.)
Code: Select all
<!-- Google Maps Declaration-->
{literal}
<__script__>
$(document).ready(function(){
$('#map').googleMaps({
geocode: 'example str., city, zip code' // the attributes is only example for this post
})
});
</__script>
{/literal}
I set some custom field in Field Definition, like as Street, City, Zip code and I want to integrate it into Google Maps script.
I tried this method in Detail template of Products Module. I thought it was working, but I have not succes.
Code: Select all
<!-- Google Maps Declaration-->
{literal}
<__script__>
$(document).ready(function(){
$('#map').googleMaps({
geocode: '{if isset($entry->fields)}{foreach from=$entry->fields item='field'}{if $field->name == 'street'}{$field->value}{/if}{/foreach}{/if}, Fixed City, {if isset($entry->fields)}{foreach from=$entry->fields item='field'}{if $field->name == 'zipcode'}{$field->value}{/if}{/foreach}{/if}'
})
});
</__script>
{/literal}
<!-- The field names an examples for this post -Z.- -->
My question is, how can I integrate the Google Maps to Products Module with custom field calls (street, city, zip code is an custom fields)?
Sorry about my enlgish, and thank you so much for your helps!
Z.

