Find a dealer 2

Support

Find a dealer 2
Error compiling template "Designs/USKidsGolf/TemplateRenderer/StoreLocatorWithZipcode.cshtml"
Line 546: 'Dynamicweb.Ecommerce.International.CountryText' does not contain a definition for 'GetRegionTexts'

1 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 2 @using Dynamicweb.Ecommerce.International 3 @using Dynamicweb.Content 4 @using Dynamicweb.Rendering 5 @{ 6 Dynamicweb.Content.Items.Item itemArea = Pageview.Area.Item; 7 int generalSettingsPageId = GetPageIdByNavigationTag("generalsettings");// Int32.Parse(itemArea["GeneralSettings"].ToString()); 8 var page = Dynamicweb.Extensibility.ServiceLocator.Current.GetPageService().GetPage(generalSettingsPageId); 9 Dynamicweb.Content.Items.Item generalSettings = page.Item; 10 11 @helper CountrySelect(System.Collections.Generic.List<String> countriesList, Dictionary<string, string> countriesNames){ 12 <label class="text-left">@Translate("selectYourCountry", "Select your country:")</label> 13 <select name="country"> 14 <option selected="selected" value="">@Translate("all", "All")</option> 15 @RenderSnippet("US") 16 @foreach (string countryCode in countriesList.OrderBy(s => s)) 17 { 18 string countryStrip = countriesNames.ContainsKey(countryCode) ? countriesNames[countryCode] : countryCode; 19 if (countryCode == "US") 20 { 21 @SnippetStart("USA") 22 <option value="@countryCode">@countryStrip</option> 23 @SnippetEnd("USA") 24 } 25 else if (countryCode == "CA") 26 { 27 @SnippetStart("CAN") 28 <option value="@countryCode">@countryStrip</option> 29 @SnippetEnd("CAN") 30 } 31 <option value="@countryCode">@countryStrip</option> 32 } 33 </select> 34 } 35 36 @helper RegionSelect(){ 37 <label class="text-left">@Translate("selectYourRegion","Select your region:")</label> 38 <select data-width="100%" name="locality"> 39 <option value="">@Translate("all","All")</option> 40 </select> 41 } 42 } 43 @{ string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", "");}@functions{ 44 public static string GetImage(string sourceString, int imageWidth, int imageHeight, int imageWidthTablet = 0, int imageHeightTablet = 0, int imageWidthMobile = 0, int imageHeightMobile = 0, string imageFormat = "jpg", int imageCompression = 0, int imageCrop = 5, string background = "", string designName = "USKidsGolf") 45 { 46 Dynamicweb.Frontend.PageView currentPageview = Dynamicweb.Frontend.PageView.Current(); 47 string currDevice = currentPageview.Device.ToString(); 48 string alternativeImage = !String.IsNullOrEmpty(currentPageview.Area.Item["NoImage"].ToString()) ? currentPageview.Area.Item["NoImage"].ToString() : "/Files/Templates/Designs/"+ designName + "/images/alternativeImage.jpg"; 49 string widthString = ""; 50 string heightString = ""; 51 string getImageFormat = imageFormat != "jpg" ? "&amp;Format=" + imageFormat : ""; 52 string getImageCompression = imageCompression != 0 ? "&amp;Compression=" + imageCompression : ""; 53 string bgColor = !string.IsNullOrEmpty(background) ? "&amp;Background="+background : ""; 54 int getImageWidth = imageWidth != 0 ? imageWidth : 0; 55 int getImageHeight = imageHeight != 0 ? imageHeight : 0; 56 57 if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Tablet.ToString()) 58 { 59 getImageWidth = imageWidthTablet != 0 ? imageWidthTablet : getImageWidth; 60 getImageHeight = imageHeightTablet != 0 ? imageHeightTablet : getImageHeight; 61 } 62 else if (currDevice == Dynamicweb.Frontend.Devices.DeviceType.Mobile.ToString()) 63 { 64 getImageWidth = imageWidthMobile != 0 ? imageWidthMobile : getImageWidth; 65 getImageHeight = imageHeightMobile != 0 ? imageHeightMobile : getImageHeight; 66 } 67 68 if (getImageWidth != 0) 69 { 70 widthString = "&amp;Width=" + getImageWidth; 71 } 72 if (getImageHeight != 0) 73 { 74 heightString = "&amp;Height=" + getImageHeight; 75 } 76 77 string output = "/Admin/Public/GetImage.ashx?Image=" + sourceString + widthString + heightString + "&amp;altFmImage_path=" + alternativeImage + getImageFormat + getImageCompression + "&amp;Crop=" + imageCrop + bgColor; 78 return output; 79 } 80 } 81 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 82 @using Dynamicweb.Rendering; 83 @using System; 84 @using System.Web; 85 @using System.Collections.Specialized; 86 87 @{ 88 string dealerGroups = generalSettings["DealerGroups"].ToString(); 89 string storesGroupID = !string.IsNullOrWhiteSpace(dealerGroups) ? "%" + dealerGroups + "%" : ""; 90 string accessDataSql = "SELECT AccessUserState, AccessUserCountry, AccessUserZip, AccessUserAddress, AccessUserName, AccessUserCity, AccessUserGeoLocationLat, AccessUserImage, AccessUserGeoLocationLng FROM accessUser WHERE AccessUserCountry is not NULL AND AccessUserCountry != '' AND AccessUserGeoLocationLat IS NOT NULL AND AccessUserGroups LIKE '" + storesGroupID + "'"; 91 string accessRegionsDataSql = "SELECT CountryTextName, CountryTextCode2, CountryTextRegionCode FROM EcomCountryText"; 92 string regionsString = "{"; 93 string country = ""; 94 string state = ""; 95 string countryLogged = !string.IsNullOrEmpty(HttpContext.Current.Request.Params["country"]) ? HttpContext.Current.Request.Params["country"] : country; 96 string stateLogged = !string.IsNullOrEmpty(HttpContext.Current.Request.Params["state"]) ? HttpContext.Current.Request.Params["state"] : state; 97 System.Data.DataRow[] dataSet = Dynamicweb.Data.Database.CreateDataSet(accessDataSql).Tables[0].Select(); 98 System.Data.DataRow[] dataRegionsSet = Dynamicweb.Data.Database.CreateDataSet(accessRegionsDataSql).Tables[0].Select(); 99 bool userIsLoggedIn = Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn(); 100 System.Collections.Generic.List<String> countriesList = dataSet.Select(r => ((string)r["AccessUserCountry"].ToString()).Trim() ).Distinct().ToList(); 101 Dictionary<string, string> countriesNames = new Dictionary<string, string>(); 102 103 foreach(System.Data.DataRow r in dataRegionsSet.Where(x => string.IsNullOrWhiteSpace(x["CountryTextRegionCode"].ToString()))) 104 { 105 if(!countriesNames.ContainsKey(r["CountryTextCode2"].ToString())) { 106 countriesNames.Add(r["CountryTextCode2"].ToString(), r["CountryTextName"].ToString()); 107 } 108 } 109 110 if(countryLogged != country) 111 { 112 stateLogged = ""; 113 } 114 115 if (userIsLoggedIn) 116 { 117 var user = Pageview.User; 118 countryLogged = user.Country.ToString(); 119 stateLogged = user.State.ToString(); 120 } 121 122 foreach (string i in countriesList) 123 { 124 System.Collections.Generic.List<String> regions = dataSet.Where(r => (string)r["AccessUserCountry"] == i).Select(r => ((string)r["AccessUserState"]).Trim() ).Distinct().ToList(); 125 int countNum = 0; 126 string countryStrip = i; 127 128 if(regionsString != "{") { 129 regionsString += ","; 130 } 131 regionsString += "\""+countryStrip+"\":["; 132 foreach (string region in regions){ 133 var regionTextList = !string.IsNullOrEmpty(region) ? dataRegionsSet.First(r => r["CountryTextRegionCode"].ToString() == region.ToString()) : null; 134 string regionText = regionTextList != null ? regionTextList["CountryTextName"].ToString() : ""; 135 136 if(!string.IsNullOrWhiteSpace(regionText)) 137 { 138 if(countNum != 0) { 139 regionsString += ","; 140 } 141 regionsString += "\""+@regionText+"\""; 142 countNum++; 143 } 144 } 145 regionsString += "]"; 146 147 } 148 regionsString += "}"; 149 } 150 <div class="dynamicweb-map" id="Maps-85" data-list-position="hidden"> 151 <div class="col-xs-12" id="findStoreFilter"> 152 <fieldset class="mandatory col-sm-3 col-xs-12" name="tag_adr"> 153 <label class="text-left" for="zipCode">@Translate("Zip Code")</label> 154 <input type="text" name="zip" id="zipCode" title="@Translate("Zip Code")" /> 155 </fieldset> 156 <fieldset class="col-sm-3 col-xs-12" name="tag_dst"> 157 <label class="text-left" for="radius">@Translate("Distance")</label> 158 <select id="radius" name="radius"> 159 <option value="5">5 @Translate("miles")</option> 160 <option value="15">15 @Translate("miles")</option> 161 <option value="25">25 @Translate("miles")</option> 162 <option value="50">50 @Translate("miles")</option> 163 </select> 164 </fieldset> 165 <div class="locations-filter col-xs-12 col-sm-3"> 166 <button class="btn btn-bg" data-filter-value="test">@Translate("search","Search")</button> 167 </div> 168 </div> 169 170 @SnippetStart("jsOnLoad") 171 onLoadMaps(); 172 @SnippetEnd("jsOnLoad") 173 <div id="loading" class="col-xs-12">&nbsp;</div> 174 <div class="map col-sm-8 col-xs-12 noPaddingLeft"> 175 <div id="Maps-85-map"></div> 176 </div> 177 <div class="list col-sm-4 col-xs-12"> 178 <div class="no-matches">@Translate("NoLocationsFound","No locations found")</div> 179 <ol class="storeList" id="Maps-85-list" data-sort-order="desc"> 180 @foreach (System.Data.DataRow store in dataSet) 181 { 182 var regionTextList = dataRegionsSet.First(r => r["CountryTextRegionCode"].ToString() == store["AccessUserState"].ToString()); 183 string regionTextString = regionTextList != null ? regionTextList["CountryTextName"].ToString() : ""; 184 185 <li data-lat="@store["AccessUserGeoLocationLat"]" data-lng="@store["AccessUserGeoLocationLng"]" data-title="@store["AccessUserName"]" 186 data-filter-values="" data-country="@store["AccessUserCountry"]" data-citycode="@store["AccessUserState"]" data-city="@regionTextString" data-sort-value="@store["AccessUserName"]"> 187 <div> 188 189 <b>@store["AccessUserName"]</b><br/> 190 191 @store["AccessUserAddress"]<br/> 192 @store["AccessUserCity"] 193 @if(!string.IsNullOrEmpty(store["AccessUserState"].ToString())) { 194 @:, @Dynamicweb.Ecommerce.International.CountryText.GetRegionTexts(store["AccessUserCountry"].ToString()).First(c => c.RegionCode == store["AccessUserState"].ToString()).Name 195 } 196 @store["AccessUserZip"] 197 </div> 198 </li> 199 } 200 </ol> 201 202 </div> 203 @SnippetStart("externalScripts") 204 <script type="text/javascript" src="//maps.googleapis.com/maps/api/js?v=3&amp;sensor=false"></script> 205 <script type="text/javascript" src="/Files/Templates/Designs/RizzoDesignFolder/Maps/javascripts/Maps.js"></script> 206 @SnippetEnd("externalScripts") 207 208 209 </div>

LA NOSTRA MISSIONE

La missione della U.S. Kids Golf e' favorire il divertimento dei bambini insegnando loro "il gioco della vita" che e' il golf e incoraggiare l'interazione con la propria famiglia affinche' si costruiscano ricordi indelebili