bjorn2404 / jQuery-Store-Locator-Plugin

A store locator plugin using Google Maps API version 3
MIT License
493 stars 235 forks source link

$(...).storeLocator is not a function in wordpress #244

Closed masivuyecokile closed 5 years ago

masivuyecokile commented 5 years ago

Good day.

I've been trying to use this plugin with wordpress and I'm getting the above mentioned error, that storelocator is not a function. Jquery is loaded the default jquery of wordpress and also everything else is loaded.

<script type="text/javascript">
jQuery.noConflict();
(function( $ ) {
    $(document).ready(function() {
        $('#sa-map-container').storeLocator({
            'taxonomyFilters' : {
                'features' : 'category-filters-container1'
            },
            'dataType'     : 'json',
            'dataLocation' : 'search-results.json',
            'defaultLoc'   : 'Cape Town',
            'defaultLat'   : "-33.9583266",
            'defaultLng'   : "25.5991323",
            'mapSettings'  : {
                zoom           : 8,
                mapTypeId      : google.maps.MapTypeId.ROADMAP

            },
            'storeLimit'             : 200,
            'featuredLocations'          : true,
            'pagination'                 : true,
            'locationsPerPage'           : 200,
            'loading'                    : true,

        });
    });
})(jQuery);
</script>
masivuyecokile commented 5 years ago

Managed to find a work around everything is working fine... thinking of building a wp plugin