Find Your Local Store (2024)

Table of Contents
Home ' + data["Store Name"] + '

Find Your Local Store (1) Find Your Local Store (2)

Use our Store Locator tool to find your closest OTS & events in your area

' }) infowindow.open(map, marker); }); return marker; } function createTile(sname, content, data) { var sp = jQuery("", { id: "idtile" + getMd5(sname), class: "store-locator__tile group" }); sp.html(content); if (isDateBeforeToday(data["Event Date DD/MM/YY"])) { sp.addClass("old"); } return sp[0].outerHTML; } function isDateBeforeToday(date) { if (!date) { return false; } var spl = date.split("/"); if (spl.length < 3) { return true; } date = new Date(spl[2], parseInt(spl[1])-1, spl[0]); return date < new Date(new Date().toDateString()); } function markHome(home) { // Create a marker for home if (homeMarker) { homeMarker.setMap(null); } var lat = home.lat(), lng = home.lng(); homeMarker = createMarkerWithInfo(lat, lng, "Home", false, '

Home

'); } function subbutactive(state) { jQuery("#search-button").removeClass("clickable"); if (state) { jQuery("#search-button").addClass("clickable"); } } function fitMap(){ if (markers.length > 1) { var bounds = new google.maps.LatLngBounds(); for (var i = 0; i < markers.length; i++) { bounds.extend(markers[i].getPosition()); } map.fitBounds(bounds); } } function displayTiles(row){ storeinfobox.empty(); var row1 = jQuery("", { class: "store-locator__tiles-row" }); row1.append(tiles[row].slice(0, 2)); row1.appendTo(storeinfobox); if (tiles[row].length > 2) { var row2 = jQuery("", { class: "store-locator__tiles-row" }); row2.append(tiles[row].slice(2, 4)); row2.appendTo(storeinfobox); } jQuery(".page-number").removeClass("active"); jQuery("#pageid-"+row).addClass("active"); } function populatePagination() { var pagination = jQuery("#store-locator__pagination .pagination-center"); pagination.empty(); if (tiles.length < 2) { return; } for (var i = 0; i < tiles.length; i++) { jQuery("", { value: i, text: i + 1, id: "pageid-" + i, class: "page-number", onclick: "displayTiles(" + i + ")" }).appendTo(pagination); } } function createInfoItem(data, itemtype) { switch (itemtype) { case "Store Name": return '

' + data["Store Name"] + '

'; break; case "distance": return '

Distance: ' + data["distance"].toFixed(1) + 'mi

'; break; case "location": return '

Location: ' + data["City"] + ", " + data["Country/Region"] + "

"; break; case "directionurl": return '
Get Directions
'; break; case "Telephone Number": if (data["Telephone Number"]) { return '

Tel: ' + data["Telephone Number"] + '

'; } break; case "E-mail Address": if (data["E-mail Address"]) { return '

Email: ' + data["E-mail Address"] + '

'; } break; case "Max Capacity": return '

Max players: ' + data["Max Capacity"] + '

'; break; case "Event Date DD/MM/YY": return '

' + data["Event Date DD/MM/YY"] + '

'; break; case "Registration Start": return '

' + data["Registration Start"] + '

'; break; case "Discord Server Link": if (data["Discord Server Link"]) { return '
Discord server
'; } break; case "kcgnlink": return '
More info on KCGN

'; break; default: break } return ""; } function createInfoString(data, infoType) { var sinfo = ''; data["directionurl"] = encodeURI("https://www.google.com/maps/dir/?api=1&" + "origin=" + place.geometry.location.lat() + "," + place.geometry.location.lng() + "&" + "destination=" + data["Address_string"]); sinfo += '

'; sinfo += createInfoItem(data, "Store Name"); sinfo += '

'; sinfo += createInfoItem(data, "distance"); sinfo += createInfoItem(data, "location"); sinfo += createInfoItem(data, "directionurl"); sinfo += '

'; sinfo += createInfoItem(data, "Telephone Number"); sinfo += createInfoItem(data, "E-mail Address"); sinfo += '

'; switch(infoType){ case "WCQ Regionals": sinfo += createInfoItem(data, "Event Date DD/MM/YY"); sinfo += createInfoItem(data, "Registration Start"); sinfo += createInfoItem(data, "Max Capacity"); break; default: if (data["sneak_dates"]) { datesaftertoday = data["sneak_dates"].filter(function(a) { splita = a.split("/"); return new Date(splita[2], splita[1]-1, splita[0]).getTime() > today; } ); sorteddates = datesaftertoday.sort(function(a,b) { splita = a.split("/"); splitb = b.split("/"); return new Date(splita[2], splita[1]-1, splita[0]) - new Date(splitb[2], splitb[1]-1, splitb[0]); }); if (sorteddates.length < 1) { return false; } else { sinfo += '

Event dates: '; if (sorteddates.length > 4) { sinfo += sorteddates.length; } else { sinfo += sorteddates.join(", "); } sinfo += '

'; } } break; } sinfo += createInfoItem(data, "Discord Server Link"); sinfo += createInfoItem(data, "kcgnlink"); return sinfo; } function getStores(loc, rad) { if (jQuery("#search-milesorkm").val() == "KM") { rad = rad * 0.621371; } var searchtype = jQuery("#search-type").val(), dat = { lat: loc.lat(), lng: loc.lng(), radius: rad, type: searchtype }; jQuery.ajax({ url: '/eu/_store-locator/store-locator-get-info.php', dataType: 'json', data: dat, success: function(data) { var counter = 0, storeinfodatastring = ""; setTimeout(function() { subbutactive(true); }, 2000); clearLocations(); markHome(loc); jQuery.each(data, function(key, val) { if (tiles[counter].length > 5) { tiles.push([]); counter++; } var infostr = createInfoString(val, searchtype); if (infostr) { markers.push(createMarkerWithInfo(parseFloat(val["Latitude"]), parseFloat(val["Longitude"]), val["Store Name"], kuri, infostr)); tiles[counter].push(createTile(val["Store Name"], infostr, val)) } }); populatePagination(); fitMap(); displayTiles(0); }, error: function( jqXHR, textStatus, errorThrown ) { console.log('jqXHR: ', jqXHR); console.log('textStatus: ', textStatus); console.log('errorThrown: ', errorThrown); console.log('dat:', dat); }, statusCode: { 404: function() { alert('There was a problem with the server. Try again soon!'); } } }); } var selectFirstOnEnter = function(input) { // store the original event binding function var _addEventListener = (input.addEventListener) ? input.addEventListener : input.attachEvent; // Simulate a 'down arrow' keypress on hitting 'return' when no pac suggestion is selected, and then trigger the original listener. function addEventListenerWrapper(type, listener) { if (type == "keydown") { var orig_listener = listener; listener = function (event) { var suggestion_selected = jQuery(".pac-item-selected").length > 0; if (event.which == 13 && !suggestion_selected) { var simulated_downarrow = jQuery.Event("keydown", { keyCode: 40, which: 40 }); orig_listener.apply(input, [simulated_downarrow]); } orig_listener.apply(input, [event]); }; } // add the modified listener _addEventListener.apply(input, [type, listener]); } if (input.addEventListener) { input.addEventListener = addEventListenerWrapper; } else if (input.attachEvent) { input.attachEvent = addEventListenerWrapper; } }

Find Your Local Store (2024)
Top Articles
Latest Posts
Article information

Author: Foster Heidenreich CPA

Last Updated:

Views: 5457

Rating: 4.6 / 5 (76 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Foster Heidenreich CPA

Birthday: 1995-01-14

Address: 55021 Usha Garden, North Larisa, DE 19209

Phone: +6812240846623

Job: Corporate Healthcare Strategist

Hobby: Singing, Listening to music, Rafting, LARPing, Gardening, Quilting, Rappelling

Introduction: My name is Foster Heidenreich CPA, I am a delightful, quaint, glorious, quaint, faithful, enchanting, fine person who loves writing and wants to share my knowledge and understanding with you.