Skip to content

Instantly share code, notes, and snippets.

@philcon93
Created December 22, 2015 07:07
Show Gist options
  • Save philcon93/4ad68a7559a3eec7f2d4 to your computer and use it in GitHub Desktop.
Save philcon93/4ad68a7559a3eec7f2d4 to your computer and use it in GitHub Desktop.
Adjusting Neto.js default parameters

Adjusting Neto.js default parameters

The old Neto Store Finder used a postcode finder that would display 10 stores based off the inputted postcode.

If the user wanted to display more they can override the original function in Neto.js:

storeLocator_Init: function(param) {
            var defvals = {
                'zip_id': 'geo_zip',
                'country_id': 'geo_country',
                'radius_id': 'geo_radius',
                'limit_id': 'geo_limit',
                'button_id': 'geo_search',
                'nearby_id': 'geo_nearby',
                'selector_id': 'geo_location_selector',
                'addr_input': 'geo_addr',
                'category_input': 'geo_category',
                'list_id': 'geo_list',
                'misc_id': 'geo_misc',
                'map_id': 'geo_map',
                'zoom_country': 4,
                'zoom_suburb': 12,
                'zoom_preset': 12,
                'default_lat': -27.000,
                'default_lng': 133.000,
                'default_country': '',
                'default_radius': 5,
                'default_limit': 10,

We edit the $.storeLocator_Int function in the store_finder template

[%SITE_VALUE id:'footer_javascript'%]
<script src="//maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$.storeLocator_Init({
default_limit:100,
page:{
body: '<li class="##item_class##" ref="##count##">##IF:thumb##<div class="thumb"><img width="40px" src="##thumb##" border="0"></div>##END IF:thumb##'+
'<a href="javascript:##script##">##name##</a><br>'+
'<span class="address">##street##, ##city##, ##state## ##zip##</span><br>'+
'<span class="distance">(##distance##km from your location)</span><br>'+
'##IF:phone##<span class="contact"><b>PH:</b> ##phone##</span><br>##END IF:phone##'+
'##IF:fax##<span class="contact"><b>Fax:</b> ##fax##</span><br>##END IF:fax##'+
'##IF:email##<span class="contact"><b>Email:</b> ##email##</span><br>##END IF:email##'+
'<a href="##url##" class="btn btn-primary">View Store</a>'+
'</li>',
info:
'<div class="##info_class##">##IF:thumb##<div class="thumb"><img src="##thumb##" border="0"></div>##END IF:thumb##'+
'<a href="##url##">##name##</a><br>'+
'<span class="address">##street##, ##city##, ##state## ##zip##</span><br>'+
'<span class="distance">(##distance##km from your location)</span><br>'+
'##IF:phone##<span class="contact"><b>PH:</b> ##phone##</span><br>##END IF:phone##'+
'##IF:fax##<span class="contact"><b>Fax:</b> ##fax##</span><br>##END IF:fax##'+
'##IF:email##<span class="contact"><b>Email:</b> ##email##</span><br>##END IF:email##'+
'<a href="##url##" class="btn btn-primary">View Store</a>'+
'</div>'
}
});
});
</script>
[%END SITE_VALUE%]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment