Exception in template (Designs\TasteTest\eCom/Product/Product.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.dcfafffbdcccb.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@using System.Text.RegularExpressions @using System.Web @using System.Globalization; @using System.Web.Helpers; @functions{ public class ProducerItem{ public int Id {get;set;} public string Url {get;set;} public string Logo {get;set;} public string Name {get;set;} } public class WrapMethods { //Gets the contrasting color public static string getContrastYIQ(string hexcolor) { if (hexcolor != "") { hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; if (yiq >= 128) { return "black"; } else { return "white"; } } else { return "black"; } } //Truncate text public static string Truncate (string value, int count, bool strip=true) { if (strip == true){ value = StripHtmlTagByCharArray(value); } if (value.Length > count) { value = value.Substring(0, count - 1) + "..."; } return value; } //Strip text from HTML public static string StripHtmlTagByCharArray(string htmlString) { char[] array = new char[htmlString.Length]; int arrayIndex = 0; bool inside = false; for (int i = 0; i < htmlString.Length; i++) { char let = htmlString[i]; if (let == '<') { inside = true; continue; } if (let == '>') { inside = false; continue; } if (!inside) { array[arrayIndex] = let; arrayIndex++; } } return new string(array, 0, arrayIndex); } //Make the correct count of columns public static string ColumnMaker(int Col, string ScreenSize) { string Columns = ""; switch (Col) { case 1: Columns = "col-"+ScreenSize+"-12"; break; case 2: Columns = "col-"+ScreenSize+"-6"; break; case 3: Columns = "col-"+ScreenSize+"-4"; break; case 4: Columns = "col-"+ScreenSize+"-3"; break; case 6: Columns = "col-"+ScreenSize+"-2"; break; default: Columns = "col-"+ScreenSize+"-3"; break; } return Columns; } public static string FirstLetterToUpper(string text) { return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(text.ToLower()); } private string Custom(string firstoption, string secondoption) { if (firstoption == "custom") { return secondoption; } else { return firstoption; } } } } @using Dynamicweb.Modules.Common.CustomFields @using Dynamicweb.Modules.UserManagement <style> .ribbon.base::before { border-top: 27px solid #BF3E38 !important;} .ribbon.base::after { border-bottom: 27px solid #BF3E38 !important; } .text_info { color: #BF3E38; } .ribbon.base { background: #BF3E38 !important; border-left:#BF3E38 !important; font-size:10px; } strong{font-weight:bold;} .product-country{font-size:12px;} </style> @helper GetProductList(dynamic Loop,int ColMD = 3, int ColSM = 6, int ColXS = 1) { int Count = 0; string ColumnsMD = WrapMethods.ColumnMaker(ColMD, "md"); string ColumnsSM = WrapMethods.ColumnMaker(ColSM, "sm"); string ColumnsXS = WrapMethods.ColumnMaker(ColXS, "xs"); string usergroups = GetGlobalValue("Global:Extranet.Groups"); bool b2b=false; if(!string.IsNullOrEmpty(usergroups)){ List<string> usergrouplist = new List<string>(usergroups.Split(',')); if(usergrouplist.Count>0) { foreach(var group in usergrouplist){ if(Convert.ToInt32(group) == 5){ b2b= true; break; } } } } bool staff= false; if (Dynamicweb.Input.FormatBoolean(GetGlobalValue("Global:Extranet.UserName"))) { int i=Convert.ToInt32(GetGlobalValue("Global:Extranet.UserID")); Dynamicweb.Modules.UserManagement.User u = Dynamicweb.Modules.UserManagement.User.GetUserByID(i); foreach (CustomFieldValue val in u.CustomFieldValues) { CustomField field = val.CustomField; string fieldValue = (val.Value).ToString(); string ff=field.Name; if(fieldValue=="Staff"){ staff = true; } } } foreach (LoopItem product in Loop) { string Image = product.GetString("Ecom:Product.ImageSmall.Default.Clean"); string GroupLink = product.GetString("Ecom:Product.LinkGroup.Clean"); if(@GetString("Ecom:ProductList:Page.ID")=="496"){ GroupLink = GroupLink.Replace("ID=496","ID=512"); } string wineRating = ""; if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductWineRating1"))){ wineRating = product.GetString("Ecom:Product:Field.ProductWineRating1")+" Points"; } string Active = product.GetString("Ecom:Product.IsActive"); string Name = product.GetString("Ecom:Product:Field.ProductName2"); string Offer = product.GetString("Ecom:Product:Field.ProductOffer"); string Hidden = ""; if("Pre-arrival offer"==@Offer){Hidden = "hidden";} string Brand = product.GetString("Ecom:Product:Field.ProductItemGroup"); string Description = product.GetString("Ecom:Product.ShortDescription"); string Discount = product.GetString("Ecom:Product.Discount.Price"); string Price = product.GetString("Ecom:Product.Price"); string Vintage = ""; if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductVintage"))){ Vintage = product.GetString("Ecom:Product:Field.ProductVintage").Replace("NV", ""); } string country = product.GetString("Ecom:Product:Field.ProductCountryOfOrigin"); string region = WrapMethods.FirstLetterToUpper(product.GetString("Ecom:Product:Field.ProductRegionOfOrigin")); string subregion = WrapMethods.FirstLetterToUpper(product.GetString("Ecom:Product:Field.ProductSubRegionOfOrigin")); string wineStyle = product.GetString("Ecom:Product:Field.ProductWineStyle").Replace("-c-", ","); var pid = product.GetString("Ecom:Product.ID"); var ProductFormClean = product.GetValue("Ecom:Product.Form.Clean"); string favLink = product.GetString("Ecom:Product.AddToFavorites").Replace("/Default.aspx?/Default.aspx/Default.aspx/Default.aspx", "/Default.aspx?ID=38"); string volume = product.GetString("Ecom:Product:Field.ProductVolumeML") + "ml"; double Stock = product.GetDouble("Ecom:Product.Stock"); //DateTime ArrivalDate =(product.GetValue("Ecom:Product:Field.ProductArrivalDate") != null) ? DateTime.MinValue : (DateTime)product.GetValue("Ecom:Product:Field.ProductArrivalDate"); wineStyle = wineStyle.Replace("-a-", "&amp;"); Brand = Brand.Replace("-a-", "&amp;").Replace("-c-", ",").Replace("-s-", "'"); <script> @if(b2b){ <text> function revealprice(id){ document.getElementById("priceperbottlelabel"+id).removeAttribute("hidden"); document.getElementById("priceperbottle"+id).removeAttribute("hidden"); } function hideprice(id){ document.getElementById("priceperbottlelabel"+id).setAttribute("hidden",""); document.getElementById("priceperbottle"+id).setAttribute("hidden",""); } </text> } </script> <script type="text/javascript"> function newPrice(price1, id) { var pricelist = price1.split('|'); @if(b2b){<text> document.getElementById(id).innerHTML ="$"+parseFloat(Math.round(pricelist[1] * 100) / 100).toFixed(2); </text> } else{<text> document.getElementById("online"+id).innerHTML = "$"+parseFloat(Math.round(pricelist[1] * 100) / 100).toFixed(2); </text> } @if(b2b){<text> document.getElementById("trade"+id).innerHTML="$"+parseFloat(Math.round(pricelist[0] * 100) / 100).toFixed(2); document.getElementById("priceperbottle"+id).innerHTML = "$"+ Math.round(parseFloat(pricelist[6]) * 100.0) / 100.0; </text> } } </script> <div class="productlist @ColumnsMD col-sm-6 @ColumnsXS" style="min-height:250px;margin-bottom:15px;"> <div class="boxproduct wp-block product" style="padding:15px 10px;float:left;width:100%;"> <div class="listproductright"> <a href="@GroupLink" title="@Name"> <figure style="border-bottom: 1px solid #E0EDED;" class="productfigure"> <img class="rotate90" alt="" src="/Admin/Public/Getimage.ashx?width=180&amp;height=180&amp;compression=85&amp;Crop=5&amp;image=@Image" /> </figure> </a> </div> <div> <p hidden id="discountFlag@(pid)" class="ribbon base"> <span> Buy @product.GetString("MinimumQuantity") get </span> <span> @product.GetString("Percentage") % discount. </span> </p> </div> <div class="extracolumn listproductleft wp-block-footer" style="min-height: 200px;"> <div name="productDes" id="productDes"> <span class="product-title" style="font-size:12px;"> <a href="@GroupLink"> <span class="product-brand"> @Brand </span><br /> <span class="product-name"> @Name @Vintage</span> </a> </span> <br /> <span class="product-country"> @country - @region @if(@subregion!="-"){ <text>- @subregion </text>} </span> <br/> <div name="longdescription"> <span hidden name="longdes"> @WrapMethods.Truncate(@product.GetString("Ecom:Product.LongDescription"),150).Replace("...","_") <a href="@GroupLink"><b>&nbsp;read more...</b></a></span><br /> <span name="winestyles" class="sub_title"> @wineStyle ( @volume.Replace(",","") ) </span> </div> </div> @{ var priceid = "price" + pid; } <div class="sub_title1" > @if(b2b) { <span class="productprice price"><strong id='@pid'></strong></span> } else{ <span class="productprice price"><strong id='online@(pid)'></strong></span> } <span>&nbsp;(incl. GST)</span><br/> @if (Discount != Price) { if(b2b){<text>Trade Price:</text>} <span class="productprice price"> <strong>@Discount</strong></span><span>&nbsp;(incl. GST)</span> <span class="productoldprice price " style="margin-top: 0px !important; padding-top: 0px !important;position: absolute; text-decoration: line-through;">( @Price )</span> } else { if(b2b) { if(!staff){<text>Trade Price:</text>}else{<text>Staff Price:</text>} <span class="productprice price sub_notitle error"><span id="trade@(pid)"></span></span><span>&nbsp;(excl. GST)</span> <p style="margin:0px"><text id="priceperbottlelabel@(pid)" hidden>Price per bottle:</text> <span class="productprice price"> <strong hidden id='priceperbottle@(pid)'></strong></span></p> } } </div> <p id="winerating"><span name="winestyles" class="sub_title">@wineRating</span></p> </div> @if (Discount != Price) { <span class="ribbon base">@Translate("On sale!", "On sale!")</span> @*if (@Pageview.Area.Item["EcommerceStickerType"].ToString() == "ribbon") { <span class="ribbon base">@Translate("On sale!", "On sale!")</span> } if (@Pageview.Area.Item["EcommerceStickerType"].ToString() == "ball") { <span class="ball">@Translate("On sale!", "On sale!")</span> }*@ } <div class="addtocart" style="min-height:105px;border-top:1px solid #BBBBBB;"> @{ var discountPString =""; if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductDiscount"))){ discountPString = product.GetString("Ecom:Product:Field.ProductDiscount"); } string[] discountstring = discountPString.Split('|'); var discountslist = new List<String>(); var quantitylist = new List<String>(); for(int i=0; i < discountstring.Length - 1; i++){ string[] discountsArray = discountstring[i].Split(':'); var percentage = discountsArray[1]; var quantity = discountsArray[2]; if(quantity == "0"){ quantity ="1"; } discountslist.Add(percentage); quantitylist.Add(quantity); } var stockRelation =""; if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockRelationship"))){ stockRelation = product.GetString("Ecom:Product:Field.StockRelationship"); } var stockPString = ""; if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.OnlinePrice"))){ stockPString = product.GetString("Ecom:Product:Field.SaleStock"); } var stockstring = stockPString.Split('|'); var stocklist = new List<int>(); for(int i=0; i < stockstring.Length - 1; i++){ string[] stockArray = stockstring[i].Split(':'); stocklist.Add(Int32.Parse(stockArray[1])); } <text> <script> </script> </text> var onlinePString = product.GetString("Ecom:Product:Field.OnlinePrice.Value"); var retailPString = product.GetString("Ecom:Product:Field.ProductRetailPrice.Value"); if((!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.OnlinePrice"))) && (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductRetailPrice")))){ var basePString = ""; if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductBasePrice"))){ basePString = product.GetString("Ecom:Product:Field.ProductBasePrice.Value"); } string[] basestring = basePString.Split('|'); var basePrice = new List<String>(); for(int i=0; i < basestring.Length - 1; i++){ string[] baseArray = basestring[i].Split(':'); basePrice.Add(baseArray[1]); } var campaignPString =""; if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductCampaign.Value"))){ campaignPString = product.GetString("Ecom:Product:Field.ProductCampaign.Value"); } string[] campaignstring = campaignPString.Split('|'); var campaignNo = new List<String>(); var campaignDate = new List<String>(); var campaignPercent = new List<String>(); var campaignQuantity = new List<String>(); for(int i=0; i < campaignstring.Length - 1; i++){ string[] campaignArray = campaignstring[i].Split(':'); campaignNo.Add(campaignArray[1]); if (campaignArray[2]!="0"){ var dateString = campaignArray[2].Split('/'); var date = dateString[1]+"/"+dateString[0]+"/"+dateString[2]; campaignDate.Add(date); } else{ campaignDate.Add(campaignArray[2]); } campaignPercent.Add(campaignArray[4]); campaignQuantity.Add(campaignArray[5]); } string[] onlinestring = onlinePString.Split('|'); string[] retailstring = retailPString.Split('|'); var prices = new List<String>(); var units = new List<String>(); var pricesretail = new List<String>(); var unitsretail = new List<String>(); for(int i=0; i < retailstring.Length - 1; i++){ string[] pricesArrayretail = retailstring[i].Split(':'); var pricewithdollar1 = pricesArrayretail[1]; pricesretail.Add(pricewithdollar1); unitsretail.Add(pricesArrayretail[0]); } for(int i=0; i < onlinestring.Length - 1; i++){ string[] pricesArray = onlinestring[i].Split(':'); var pricewithdollar = pricesArray[1]; prices.Add(pricewithdollar); units.Add(pricesArray[0]); } bool loopExist = true; var outofstock =false; if(@stocklist[0] <=0){ outofstock = true; } if ((@Offer=="Pre-arrival offer")||@stocklist[0] >0) { <input @Hidden id="quantityinput@(pid)" data-maxstock = "@stocklist.Max()" data-uom = "@units[0]" data-stockrelation = "@stockRelation" onchange="changeLinkquantity(this.value, this, '@pid');" type="number" name="Quantity" value="1" class="qtyBox" min="1" max="@stocklist[0]" style="width:50px;margin:10px 1px 10px -20px;border-radius:5px;padding:2px;border:2px solid #BF3E38;text-align:right;" /> <select style="width:80px;margin:10px 1px;padding:2px;border-radius:5px;border:2px solid #BF3E38;text-align:right;" id="unitID@(pid)" name="UnitID1" onchange="newPrice(this.value, '@pid');changeLink(this, '@pid');changeCampaign(this.value, '@pid',this.options[this.selectedIndex].innerHTML);"> @for(var i =0; i< prices.Count; i++){ if (i==0){ <option selected data-unit="@units[i]" value='@prices[i]|@pricesretail[i]|@campaignNo[i]|@campaignDate[i]|@discountslist[i]|@quantitylist[i]|@basePrice[i]|@stocklist[i]|@pid'>@units[i].First().ToString().ToUpper()@(units[i].Substring(1).ToLower())</option> } else{ <option data-unit="@units[i]" value='@prices[i]|@pricesretail[i]|@campaignNo[i]|@campaignDate[i]|@discountslist[i]|@quantitylist[i]|@basePrice[i]|@stocklist[i]|@pid'>@units[i].First().ToString().ToUpper()@(units[i].Substring(1).ToLower())</option> } } </select> <script> var totalquantity = 0; var select = document.getElementById("unitID"+productid); var link1 = document.getElementById("addtocart@(pid)"); var variantnamedefault = "@units[0]"; var defaultprice = '@prices[0] | @pricesretail[0]'; var defaultquantity ="1"; var productid = "@pid"; var linkstring = ""; var quantityvalue = ""; var unitvalue = ""; var selectedindex = ""; var currentuom = ""; newPrice(defaultprice, productid); function changeLink(select,id){ @if (@Offer!="Pre-arrival offer"){<text> selectedindex = select.selectedIndex; @if(b2b){<text> if (parseInt(selectedindex)>0){ revealprice(id); } else{ hideprice(id); } </text> } link1 = document.getElementById("addtocart"+id); link1.removeAttribute("disabled"); unitvalue = select.getElementsByTagName('option')[select.selectedIndex].text.toUpperCase(); quantityvalue = document.getElementById("quantityinput"+id).value; if (select==null){ unitvalue = variantnamedefault; } linkstring='/default.aspx?ID=496&productid='+id+'&VariantId='+unitvalue+'&cartcmd=add&quantity='+quantityvalue; link1.setAttribute("href",linkstring); var optionvalue = select.getElementsByTagName('option')[select.selectedIndex].value.split('|'); var inputbox = document.getElementById("quantityinput"+id); inputbox.max = optionvalue[7]; currentuom = unitvalue; var inputjq = jQuery(inputbox); $(inputjq).data('uom',unitvalue); </text> } } function changeLinkquantity(quantity1, input, id){ var inputjq = jQuery(input); currentuom = $(inputjq).data('uom'); var defaultuomstock =$(inputjq).data('maxstock'); var link2 = document.getElementById("addtocart"+id); link2.removeAttribute("disabled"); var link = link2.href; var temp = link.split('quantity='); var stockrelationjs = $(inputjq).data('stockrelation'); if (typeof(Storage) != "undefined") { // Store localStorage.setItem("stockrelation"+id, stockrelationjs+";"+defaultuomstock); } else { document.getElementById("result").innerHTML = "Sorry, Please use another browser!"; } var orderstocks = $(inputjq).data('stockcontrol'); if(orderstocks != null){ var currentstockrelation = ""; var currentuomorderstock = ""; var relationlist = stockrelationjs.split("|"); for(var i = 0; i<relationlist.length; i++){ var relationsplit = relationlist[i].split(":"); if (relationsplit[0]==currentuom){ currentstockrelation = relationsplit[1]; } } var ordertotalquantity = 0; var orderstocklist = orderstocks.split("|"); for (var i =0; i< orderstocklist.length-1;i++){ var ordersplit = orderstocklist[i].split(":"); for(var j = 0; j<relationlist.length-1; j++){ var relationsplit = relationlist[j].split(":"); if(ordersplit[1]==relationsplit[0]){ ordertotalquantity += parseInt(ordersplit[0])*parseInt(relationsplit[1]); } } } var totalquantity = ordertotalquantity+(parseInt(quantity1)*currentstockrelation); var currenttotal = parseInt(input.max)*parseInt(currentstockrelation); if(totalquantity <= defaultuomstock){ link = (temp[0]+"quantity="+ quantity1); link2.href = link; return true; } else{ alert("Exceeded Maximum Stock!"); input.value = 1; link = (temp[0]+"quantity="+ 1); link2.href = link; return false; } } else { if (parseInt(quantity1) <= parseInt(input.max)){ link = (temp[0]+"quantity="+ quantity1); link2.href = link; return true; } else{ alert("Maximum allowed quantity for this product is "+input.max); input.value = input.max; link = (temp[0]+"quantity="+ input.max); link2.href = link; return false; } } } function checkquantity(addtocartlink, id){ var input2 = document.getElementById("quantityinput"+id); var quantity2 = document.getElementById("quantityinput"+id).value; if(changeLinkquantity(quantity2, input2, id)==false){ addtocartlink.setAttribute("disabled",""); return false; } else{ addtocartlink.removeAttribute("disabled"); return true; } } function firsttimeLink (){ @if("Pre-arrival offer"!=@Offer){ <text> var firstSelect = document.getElementById("unitID"+productid); var firstUnit = firstSelect.getElementsByTagName('option')[firstSelect.selectedIndex].text.toUpperCase(); var firstLink = '/default.aspx?ID=@GetString("Ecom:Product.PrimaryOrCurrentPageID")&productid='+productid+'&VariantId='+firstUnit+'&cartcmd=add&quantity=1'; var link3 = document.getElementById("addtocart"+productid); link3.setAttribute("href",firstLink); </text> } var firstOption = select.getElementsByTagName('option')[select.selectedIndex].value; var firstValueList = firstOption.split('|'); if(firstValueList[2]!=0){ document.getElementById("test"+firstValueList[8]).innerHTML = "Now on offer until: "+firstValueList[3]+"<br> Campaign No: "+firstValueList[2]; } if(firstValueList[5]!=0){ var flag = document.getElementById("discountFlag"+firstValueList[8]); flag.removeAttribute("hidden"); flag.getElementsByTagName("span")[0].innerHTML = "Buy "+firstValueList[5]+" "+ select.getElementsByTagName('option')[select.selectedIndex].text; flag.getElementsByTagName("span")[1].innerHTML =" get "+ firstValueList[4]+"% discount"; } } </script> if("Pre-arrival offer"!=@Offer){ <text> <a href='/default.aspx?ID=496&productid=@pid&VariantId=BOTTLE&cartcmd=add&quantity=1' onclick="return checkquantity(this,'@pid')" id="addtocart@(pid)" class="btn btn-sm btn-two" style="padding-bottom:2px;margin-bottom:2px;"><i class="glyphicon glyphicon-shopping-cart" title="@Translate("Add to cart","Add to cart")"></i></a> <script> $( document ).ready(function() { select = document.getElementById("unitID"+productid); link1 = document.getElementById("addtocart"+productid); variantnamedefault = "@units[0]"; defaultprice = "@prices[0]" defaultquantity ="1"; productid = "@pid"; linkstring = ""; firsttimeLink (); }); </script> </text> } else{ <text> @if(@discountslist[0]!=""){ <script> $( document ).ready(function() { select = document.getElementById("unitID"+productid); //link1 = document.getElementById("addtocart"+productid); variantnamedefault = "@units[0]"; defaultprice = "@prices[0]" defaultquantity ="1"; productid = "@pid"; linkstring = ""; firsttimeLink (); }); </script> } <a href="@GroupLink" class="btn btn-sm btn-two" style="padding-bottom:2px;margin-bottom:2px;">More Detail</a> </text> } } else { <p class="ribbon base"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sold Out&nbsp;&nbsp;&nbsp;&nbsp;</span></p> <button type="submit" style="font-size:12px;text-decoration: line-through;display:none" class="btn btn-two" > <i class="glyphicon glyphicon-shopping-cart" title="@Translate("Add to cart","Add to cart")"></i></button> } if (Dynamicweb.Input.FormatBoolean(GetGlobalValue("Global:Extranet.UserName"))&&("Pre-arrival offer"!=@Offer)) { <a onclick='AddToFavorites("@favLink","@pid")' class="add-fav tooltipHere" style="top:inherit;right:inherit;margin-top:8px;float:right;@if(outofstock){<text>display:none</text>}" data-toggle="tooltip"> <i id="gly_@pid" class="glyphicon glyphicon-heart"></i> <i id="gid_@pid" class="glyphicon glyphicon-heart" style="display:none;color:#a73c4a !important"></i> <img id="img_@pid" src="Files/Images/TOT/favloading.gif" style="display:none;margin-bottom:6px;width:20px;height:20px;"> </a> } } <div id="campaign@(pid)" class="text_info" style="min-height:39px;"> <p id="test@(pid)"></p> </div> } <script> //Set min discount qty $(document).ready(function(){ var tagIsExist = (document.getElementById("unitID"+"@(pid)"))!==null; if(tagIsExist) { var minDiscountQty = (((document.getElementById("unitID"+"@(pid)")).getElementsByTagName('option')[(document.getElementById("unitID"+"@(pid)")).selectedIndex].value).split('|')[5]); if(minDiscountQty < 1) { minDiscountQty = 1 } $('#quantityinput@(pid)').val(minDiscountQty); } }); $('#unitID@(pid)').change(function(){ var minDiscountQty = (((document.getElementById("unitID"+"@(pid)")).getElementsByTagName('option')[(document.getElementById("unitID"+"@(pid)")).selectedIndex].value).split('|')[5]); if(minDiscountQty < 1) { minDiscountQty = 1 } $('#quantityinput@(pid)').val(minDiscountQty); }); </script> </div> </div> </div> Count++; if (Count == ColMD) { <div name="row3" class="row"></div> Count = 0; } else if (Count == 4){ <div hidden name="row4" class="row"></div> } } } <script> function changeCampaign(value, id, unit) { var valuelist = value.split('|'); if (valuelist[4]!=0) { var flag = document.getElementById("discountFlag"+id); flag.removeAttribute("hidden"); flag.getElementsByTagName("span")[0].innerHTML = "Buy "+valuelist[5]+" "+unit; flag.getElementsByTagName("span")[1].innerHTML = " get "+valuelist[4]+"% discount"; document.getElementById("test"+id).innerHTML = ""; if(valuelist[2]!=0) { var string1 = "Now on offer until: "+valuelist[3]+"<br> Campaign No: "+valuelist[2]; document.getElementById("test"+id).innerHTML = string1; } } else { var flag = document.getElementById("discountFlag"+id); flag.setAttribute("hidden",""); document.getElementById("test"+id).innerHTML = ""; } } </script> @{ string image = ""; var grouplink = ""; string productname = ""; var pid = GetValue("Ecom:Product.ID"); } <script type="text/javascript"> /* CLASSES */ function VariantGroup(id, name) { this.Id = id; this.Name = name; this.Options = []; } function VariantOption(id, name) { this.Id = id; this.Name = name; } function VariantCombination(id) { this.Id = id; } function VariantSelector() { this.Groups = []; this.Combinations = []; } /* FUNCTIONS */ function ByGroupOrder(varid) { var vars = []; for (g = 0; g < Selector.Groups.length; g++) { for (o = 0; o < Selector.Groups[g].Options.length; o++) { for (v = 0; v < varid.length; v++) { if (Selector.Groups[g].Options[o].Id == varid[v]) { vars.push(varid[v]); } } } } return vars; } function PresetCombo(combono, value) { document.getElementById('COMBO' + combono).value = value; UpdateCombo(combono); } function CombinationExist(query) { found = false; for (ci = 0; ci < Selector.Combinations.length; ci++) { combis = Selector.Combinations[ci].Id.split("."); queryfoundincombination = true; for (q = 0; q < query.length; q++) { queryitemfoundincombination = false; for (cs = 0; cs < combis.length; cs++) { if (combis[cs] == query[q]) queryitemfoundincombination = true; } if (!queryitemfoundincombination) queryfoundincombination = false; } if (queryfoundincombination) found = true; } return found; } function FillCombo(combono) { ClearCombo(combono); @{ var selectiontext = @Translate("Choose variant", "Choose variant"); } var op = document.createElement("option"); op.text = "@selectiontext"; op.value = ""; document.getElementById('COMBO' + combono).options.add(op); for (i = 0; i < Selector.Groups[combono].Options.length; i++) { option = Selector.Groups[combono].Options[i]; includeoption = true; curcombination = []; for (g = 0; g < combono; g++) { curcombination.push(document.getElementById('COMBO' + g).value); } curcombination.push(option.Id); includeoption = CombinationExist(curcombination); if (includeoption) { var op = document.createElement("option"); op.text = option.Name; op.value = option.Id; document.getElementById('COMBO' + combono).options.add(op); document.getElementById('COMBO' + combono).disabled = false; } } } function ClearCombo(combono) { while (document.getElementById('COMBO' + combono).options.length > 0) { document.getElementById('COMBO' + combono).options[0] = null; } document.getElementById('COMBO' + combono).disabled = true; } function UpdateCombo(combono) { if (combono < Selector.Groups.length - 1) { if (document.getElementById('COMBO' + combono).value != "") FillCombo((combono + 1)); if (combono > -1) { fromcombo = (document.getElementById('COMBO' + combono).value == "") ? combono + 1 : combono + 2; for (c = fromcombo; c < Selector.Groups.length; c++) { ClearCombo(c); } } } else { if (!presetting && (document.getElementById('COMBO' + (Selector.Groups.length - 1)).value != "")) { id = ""; for (c = 0; c < Selector.Groups.length; c++) { id += (c == 0) ? document.getElementById('COMBO' + c).value : "." + document.getElementById('COMBO' + c).value; } document.location.href = Page + "&VariantID=" + id; //Spinner var opts = { lines: 9, // The number of lines to draw length: 0, // The length of each line width: 10, // The line thickness radius: 18, // The radius of the inner circle corners: 1, // Corner roundness (0..1) rotate: 0, // The rotation offset direction: 1, // 1: clockwise, -1: counterclockwise color: '#000', // #rgb or #rrggbb or array of colors speed: 1, // Rounds per second trail: 35, // Afterglow percentage shadow: false, // Whether to render a shadow hwaccel: false, // Whether to use hardware acceleration className: 'spinner', // The CSS class to assign to the spinner zIndex: 2e9, // The z-index (defaults to 2000000000) top: '50%', // Top position relative to parent left: '50%' // Left position relative to parent }; var target = document.getElementById('productinfo'); var spinner = new Spinner(opts).spin(target); } } } function UpdateCart() { document.getElementById('minipagecart').className = " dw-minicart-update"; document.getElementById('minipagecart-button').className = "btn btn-sm dw-minicart-update"; } </script> @{ string imagesize = ""; string infosize = ""; switch(Pageview.Area.Item["EcommerceProductcardImageSize"].ToString()) { case "small": imagesize = "4"; infosize = "8"; break; case "medium": imagesize = "6"; infosize = "6"; break; case "large": imagesize = "12"; infosize = "12"; break; } } <div class="col-md-12 col-sm-12 col-xs-12"> <div class="row container product"> <div class="col-md-@imagesize col-sm-12 col-xs-12"> <div class="product-gallery"> <!-- Discount sticker --> @if (GetString("Ecom:Product.Discount.Price") != GetString("Ecom:Product.Price")) { if (@Pageview.Area.Item["EcommerceStickerType"].ToString() == "ribbon") { <span class="ribbon base">@Translate("On sale!", "On sale!")</span> } if (@Pageview.Area.Item["EcommerceStickerType"].ToString() == "ball") { <span class="ball">@Translate("On sale!", "On sale!")</span> } } @{ image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Ecom:Product.ImageLarge.Default.Clean")); } <div class="col-xs-12 col-sm-4 primary-image "> <a href="@image" class="fancybox"> <img src="@image" class="img-responsive" alt="Product image"> </a> </div> <div>&nbsp;</div> <div class="row"> @foreach (LoopItem detail in GetLoop("Details")) { image = System.Web.HttpContext.Current.Server.UrlEncode(detail.GetString("Ecom:Product:Detail.Image.Clean")); <div class="col-md-3 col-sm-4 col-xs-12"> <div class="thumbnail-images"> <a href="@image" class="fancybox"> <img src="@image" alt=""> </a> </div> </div> } </div> </div> </div> <div class="col-md-@infosize col-sm-12 col-xs-12"> <form name="@pid" id="@pid" method="post" action="/Default.aspx"> @GetValue("Ecom:Product.Form.Clean") <div class="product-info" vocab="http://schema.org/" typeof="Product" id="productinfo"> <h1><span property="name">@GetString("Ecom:Product.Name")</span> @GetString("Ecom:Product.SelectedVariantComboName")</h1> <span class="clearfix"></span> <div property="description" id="description"> @GetString("Ecom:Product.ShortDescription") </div> <span class="clearfix"></span> <!-- DYNAMIC VARIANT OPTION --> <div id="productvariants"> <!-- SELECTOR MAIN --> @{ var pageid = GetValue("Ecom:Product:Page.ID"); var productid = GetValue("Ecom:Product.ID"); } <script type="text/javascript"> var presetting = true; var VariantID = "@GetValue("Ecom:Product.SelectedVariantComboID")"; var VariantOptions = VariantID.split('.'); var Page = "/Default.aspx?ID=@pageid&ProductID=@productid"; var Selector = new VariantSelector(); </script> <script type="text/javascript"> @foreach (LoopItem variantgroup in GetLoop("VariantGroups")) { var variantgroupid = variantgroup.GetValue("Ecom:VariantGroup.ID"); var variantgroupname = variantgroup.GetString("Ecom:VariantGroup.Name"); <text>group = new VariantGroup("@variantgroupid", "@variantgroupname");</text> foreach (LoopItem variantoption in variantgroup.GetLoop("VariantOptions")) { var variantoptionid = variantoption.GetValue("Ecom:VariantOption.ID"); var variantoptionname = variantoption.GetString("Ecom:VariantOption.Name"); <text>group.Options.push(new VariantOption("@variantoptionid", "@variantoptionname"));</text> } <text>Selector.Groups.push(group);</text> } </script> <script type="text/javascript"> @foreach (LoopItem variantcomb in GetLoop("VariantCombinations")) { var variantcombid = variantcomb.GetValue("Ecom:VariantCombination.VariantID"); <text>Selector.Combinations.push(new VariantCombination("@variantcombid"));</text> } </script> <script type="text/javascript"> for (g = 0; g < Selector.Groups.length; g++) { document.write("<br><b>" + Selector.Groups[g].Name + "</b><br>"); document.write("<select id='COMBO" + g + "' style='width:40%' onchange=\"UpdateCombo(" + g + ");\">\n</select><br>\n"); } FillCombo(0); for (vo = 0; vo < VariantOptions.length; vo++) { PresetCombo(vo, VariantOptions[vo]); } presetting = false; </script> </div> <hr/> <div property="offers" typeof="Offer"> <div class="row"> <span class="clearfix"></span> <div class="product-short-info"> @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Stock.Text"))) { image = GetString("Ecom:Product:Stock.Image.Clean"); <div class="col-md-6 col-xs-12"> <p><small>@Translate("Availability", "Availability"): <span property="availability">@GetString("Ecom:Product:Stock.Text")</span>: </small><img src="@image" alt="@GetString("ecom:product:stock.text")" style="width:7px !important; height:7px !important" /></p> </div> <div class="col-md-6 col-xs-12"> <p><small>@Translate("Delivery", "Delivery"): @GetString("Ecom:Product:Stock.DeliveryText")&nbsp;@GetString("Ecom:Product:Stock.DeliveryUnit")</small></p> </div> } <div class="col-md-6 col-xs-12"> <p><small>@Translate("Product number", "Product number"): <span property="identifier">@GetString("Ecom:Product.Number")</span></small></p> </div> @if (GetLoop("BOMProducts").Count > 0){ <div class="col-md-12 col-xs-12" id="includingproducts"> <hr/> <h3 class="section-title">@Translate("Including products", "Including products")</h3> @foreach (LoopItem bomproduct in GetLoop("BOMProducts")){ var bomimage = bomproduct.GetString("Ecom:Product.ImageSmall.Clean"); <ul> <li class="bomlist"><a href="@bomproduct.GetString("Ecom:Product.Link.Clean.PID")"> <img src="/Admin/Public/GetImage.ashx?width=50&amp;image=@bomimage&amp;Compression=99" alt=""> <text>&nbsp;&nbsp;&nbsp;</text>@bomproduct.GetString("Ecom:Product.Name") </a></li> </ul> } <table cellspacing="0" cellpadding="0" border="0"> @foreach (LoopItem bomconfig in GetLoop("BOMConfigurators")){ <tr> <td> <b>@bomconfig.GetString("Ecom:Product.Configurator.Name")</b><br> <select name="@bomconfig.GetString("Ecom:Product.Configurator.ID")"> @foreach (LoopItem configproduct in GetLoop("ConfiguratorProducts")){ <option value="@configproduct.GetString("Ecom:Product.ID")" @configproduct.GetString("Ecom:Product.Configurator.Selected") > @configproduct.GetString("Ecom:Product.Name") ( @configproduct.GetString("Ecom:Product.ActualPrice")" ) </option> } </select> </td> </tr> } </table> </div> } </div> </div> <hr/> <div class="row"> <div class="col-md-12 col-xs-12"> @{ var currency = GetString("Ecom:Product.Price.Currency.Code"); } <meta property="priceCurrency" content="@currency" /> @if (GetString("Ecom:Product.Discount.Price") != GetString("Ecom:Product.Price")) { <span class="price pull-left" style="font-size: 28px !important" property="price"> @GetString("Ecom:Product.Discount.Price") </span> <span>&nbsp;&nbsp;</span> <p style="margin-top: 0px !important; padding-top: 10px !important; color: #AAAAAA !important; font-size: 12px !important; position: absolute; text-decoration: line-through"> <strong>@GetString("Ecom:Product.Price")</strong> <!-- @GetString("Ecom:Product.Discount.TotalPercentWithVATFormatted") --> </p> } else { <span class="price pull-left" style="font-size: 28px !important; margin-top:4px !important" property="price"> @GetString("Ecom:Product.Discount.Price") </span> } <button type="submit" name="submit" onclick="UpdateCart();" class="btn btn-dw-cart pull-right"><strong>@Translate("Add to cart", "Add to cart")</strong></button> <input type="number" name="Quantity" value="1" class="pull-right" style="width:60px; text-align:center; margin-right:15px !important; height:34px;"> </div> </div> <hr/> </div> </div> </form> </div> @if(Dynamicweb.Base.IsModuleInstalled("LoyaltyPoints")) { @* Buy with loyalty points start *@ var productPoints = GetDouble("Ecom:Product.PointPrice"); <div class="col-md-6 col-sm-12 col-xs-12"> @if (productPoints > 0) { <span class="price pull-left" style="font-size: 22px !important; margin-top:4px !important">@productPoints @Translate("Points", "Points")</span> var user = Dynamicweb.Modules.UserManagement.User.get_Current(Dynamicweb.Modules.UserManagement.PagePermissionLevels.Frontend); if (user == null) { <div class="alert alert-info">@Translate("Sign in to buy this product using points")</div> } else { var availablePoints = user != null ? user.PointBalance : 0; var cart = Dynamicweb.eCommerce.Common.Context.Cart; var pointsUsedInCart = cart != null ? cart.TotalPoints : 0; if (availablePoints < productPoints + pointsUsedInCart) { <div class="alert alert-danger">@string.Format(Translate("You don't have enough points to buy this product using points ({0:0.00}/{1:0.00})"), availablePoints, productPoints + pointsUsedInCart)</div> } else { var ProductID = GetValue("Ecom:Product.ID"); <form method="post" role="form"> <input type="hidden" name="ProductID" value="@ProductID" /> <button type="submit" onclick="UpdateCart();" class="btn btn-dw-secondary pull-right" name="CartCmd" value="addWithPoints">@Translate("Buy for") @productPoints @Translate("points")</button> </form> } } } </div> <div class="col-md-6 col-sm-12 col-xs-12"> <hr/> </div> @* Buy with loyalty points end *@ } </div> <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <h2>@Translate("Description", "Description")</h2> <p> @GetString("Ecom:Product.LongDescription") </p> </div> </div> <div class="row"><hr/></div> <!-- RELATED PRODUCTS --> @if (Pageview.Area.Item["RelatedProducts"].ToString() == "True"){ if (GetString("Ecom:Product.RelatedCount") != "0"){ <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <h3 class="dw-section-title"><span>@Translate("Related products", "Related products")</span></h3> </div> </div> foreach (LoopItem relatedgroup in GetLoop("ProductRelatedGroups")){ <div class="row"> @{ var relatedproductloop = relatedgroup.GetLoop("RelatedProducts").OrderByDescending(g => g.GetString("Ecom:Product.LoopCounter")).Take(3).ToList(); } @GetProductList(relatedproductloop, 3, 3, 1) </div> <div class="row"><hr/></div> } } } @if (Pageview.Area.Item["CustomersAlsoSaw"].ToString() == "True"){ if (GetString("eCom:Related.CustomersWhoSawThisAlsoSaw.Count") != "0"){ <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <h3 class="dw-section-title"><span>@Translate("Other costumers also saw", "Other costumers also saw")</span></h3> </div> </div> <div class="row"> @{ var alsoproductgroup = GetLoop("eCom:Related.CustomersWhoSawThisAlsoSaw").OrderByDescending(g => g.GetString("Ecom:Product.LoopCounter")).Take(3).ToList(); } @GetProductList(alsoproductgroup, 3, 3, 1) </div> <div class="row"><hr/></div> } } @if (Pageview.Area.Item["YourLastSeenProducts"].ToString() == "True"){ if (GetString("eCom:Related.YouHaveSeenTheseProducts.Count") != "0"){ <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <h3 class="dw-section-title"><span>@Translate("Recently viewed items", "Recently viewed items")</span></h3> </div> </div> <div class="row"> @{ var recentproductgroup = GetLoop("eCom:Related.YouHaveSeenTheseProducts").OrderByDescending(g => g.GetString("Ecom:Product.LoopCounter")).Take(3).ToList(); } @GetProductList(recentproductgroup, 3, 3, 1) </div> <div class="row"><hr/></div> } } @if (Pageview.Area.Item["ProductsFromCategory"].ToString() == "True"){ if (GetString("eCom:Related.WhatAboutTheseProducts.Count") != "0"){ <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <h3 class="dw-section-title"><span>@Translate("Other great products in the same category", "Other great products in the same category")</span></h3> </div> </div> <div class="row"> @{ var aboutproductgroup = GetLoop("eCom:Related.WhatAboutTheseProducts").OrderByDescending(g => g.GetString("Ecom:Product.LoopCounter")).Take(3).ToList(); } @GetProductList(aboutproductgroup, 3, 3, 1) </div> <div class="row"><hr/></div> } } <div class="row"><div class="col-md-12 col-sm-12 col-xs-12">&nbsp;</div></div> </div> </div> </div> </div>

Welcome to E-Commerce enabled site.

Browse through our inventory from a fine selction of winemakers and wines that have shipped direct from the winery in refridgerated Containers, and stored in our cellars, throughout the wines are kept at 12-15 degrees Celsius.

​Already a Customer? Contact us to activate your account and receive your tier or trade benefits online.

​Keep shopping with us through our offers and upgrade through to Silver and Gold VIP tiers and enjoy the benefits.

Recent News

Exception in template (Designs\TasteTest\eCom/Product/Product.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.dcfafffbdcccb.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@using System.Text.RegularExpressions @using System.Web @using System.Globalization; @using System.Web.Helpers; @functions{ public class ProducerItem{ public int Id {get;set;} public string Url {get;set;} public string Logo {get;set;} public string Name {get;set;} } public class WrapMethods { //Gets the contrasting color public static string getContrastYIQ(string hexcolor) { if (hexcolor != "") { hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; if (yiq >= 128) { return "black"; } else { return "white"; } } else { return "black"; } } //Truncate text public static string Truncate (string value, int count, bool strip=true) { if (strip == true){ value = StripHtmlTagByCharArray(value); } if (value.Length > count) { value = value.Substring(0, count - 1) + "..."; } return value; } //Strip text from HTML public static string StripHtmlTagByCharArray(string htmlString) { char[] array = new char[htmlString.Length]; int arrayIndex = 0; bool inside = false; for (int i = 0; i < htmlString.Length; i++) { char let = htmlString[i]; if (let == '<') { inside = true; continue; } if (let == '>') { inside = false; continue; } if (!inside) { array[arrayIndex] = let; arrayIndex++; } } return new string(array, 0, arrayIndex); } //Make the correct count of columns public static string ColumnMaker(int Col, string ScreenSize) { string Columns = ""; switch (Col) { case 1: Columns = "col-"+ScreenSize+"-12"; break; case 2: Columns = "col-"+ScreenSize+"-6"; break; case 3: Columns = "col-"+ScreenSize+"-4"; break; case 4: Columns = "col-"+ScreenSize+"-3"; break; case 6: Columns = "col-"+ScreenSize+"-2"; break; default: Columns = "col-"+ScreenSize+"-3"; break; } return Columns; } public static string FirstLetterToUpper(string text) { return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(text.ToLower()); } private string Custom(string firstoption, string secondoption) { if (firstoption == "custom") { return secondoption; } else { return firstoption; } } } } @using Dynamicweb.Modules.Common.CustomFields @using Dynamicweb.Modules.UserManagement <style> .ribbon.base::before { border-top: 27px solid #BF3E38 !important;} .ribbon.base::after { border-bottom: 27px solid #BF3E38 !important; } .text_info { color: #BF3E38; } .ribbon.base { background: #BF3E38 !important; border-left:#BF3E38 !important; font-size:10px; } strong{font-weight:bold;} .product-country{font-size:12px;} </style> @helper GetProductList(dynamic Loop,int ColMD = 3, int ColSM = 6, int ColXS = 1) { int Count = 0; string ColumnsMD = WrapMethods.ColumnMaker(ColMD, "md"); string ColumnsSM = WrapMethods.ColumnMaker(ColSM, "sm"); string ColumnsXS = WrapMethods.ColumnMaker(ColXS, "xs"); string usergroups = GetGlobalValue("Global:Extranet.Groups"); bool b2b=false; if(!string.IsNullOrEmpty(usergroups)){ List<string> usergrouplist = new List<string>(usergroups.Split(',')); if(usergrouplist.Count>0) { foreach(var group in usergrouplist){ if(Convert.ToInt32(group) == 5){ b2b= true; break; } } } } bool staff= false; if (Dynamicweb.Input.FormatBoolean(GetGlobalValue("Global:Extranet.UserName"))) { int i=Convert.ToInt32(GetGlobalValue("Global:Extranet.UserID")); Dynamicweb.Modules.UserManagement.User u = Dynamicweb.Modules.UserManagement.User.GetUserByID(i); foreach (CustomFieldValue val in u.CustomFieldValues) { CustomField field = val.CustomField; string fieldValue = (val.Value).ToString(); string ff=field.Name; if(fieldValue=="Staff"){ staff = true; } } } foreach (LoopItem product in Loop) { string Image = product.GetString("Ecom:Product.ImageSmall.Default.Clean"); string GroupLink = product.GetString("Ecom:Product.LinkGroup.Clean"); if(@GetString("Ecom:ProductList:Page.ID")=="496"){ GroupLink = GroupLink.Replace("ID=496","ID=512"); } string wineRating = ""; if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductWineRating1"))){ wineRating = product.GetString("Ecom:Product:Field.ProductWineRating1")+" Points"; } string Active = product.GetString("Ecom:Product.IsActive"); string Name = product.GetString("Ecom:Product:Field.ProductName2"); string Offer = product.GetString("Ecom:Product:Field.ProductOffer"); string Hidden = ""; if("Pre-arrival offer"==@Offer){Hidden = "hidden";} string Brand = product.GetString("Ecom:Product:Field.ProductItemGroup"); string Description = product.GetString("Ecom:Product.ShortDescription"); string Discount = product.GetString("Ecom:Product.Discount.Price"); string Price = product.GetString("Ecom:Product.Price"); string Vintage = ""; if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductVintage"))){ Vintage = product.GetString("Ecom:Product:Field.ProductVintage").Replace("NV", ""); } string country = product.GetString("Ecom:Product:Field.ProductCountryOfOrigin"); string region = WrapMethods.FirstLetterToUpper(product.GetString("Ecom:Product:Field.ProductRegionOfOrigin")); string subregion = WrapMethods.FirstLetterToUpper(product.GetString("Ecom:Product:Field.ProductSubRegionOfOrigin")); string wineStyle = product.GetString("Ecom:Product:Field.ProductWineStyle").Replace("-c-", ","); var pid = product.GetString("Ecom:Product.ID"); var ProductFormClean = product.GetValue("Ecom:Product.Form.Clean"); string favLink = product.GetString("Ecom:Product.AddToFavorites").Replace("/Default.aspx?/Default.aspx/Default.aspx/Default.aspx", "/Default.aspx?ID=38"); string volume = product.GetString("Ecom:Product:Field.ProductVolumeML") + "ml"; double Stock = product.GetDouble("Ecom:Product.Stock"); //DateTime ArrivalDate =(product.GetValue("Ecom:Product:Field.ProductArrivalDate") != null) ? DateTime.MinValue : (DateTime)product.GetValue("Ecom:Product:Field.ProductArrivalDate"); wineStyle = wineStyle.Replace("-a-", "&amp;"); Brand = Brand.Replace("-a-", "&amp;").Replace("-c-", ",").Replace("-s-", "'"); <script> @if(b2b){ <text> function revealprice(id){ document.getElementById("priceperbottlelabel"+id).removeAttribute("hidden"); document.getElementById("priceperbottle"+id).removeAttribute("hidden"); } function hideprice(id){ document.getElementById("priceperbottlelabel"+id).setAttribute("hidden",""); document.getElementById("priceperbottle"+id).setAttribute("hidden",""); } </text> } </script> <script type="text/javascript"> function newPrice(price1, id) { var pricelist = price1.split('|'); @if(b2b){<text> document.getElementById(id).innerHTML ="$"+parseFloat(Math.round(pricelist[1] * 100) / 100).toFixed(2); </text> } else{<text> document.getElementById("online"+id).innerHTML = "$"+parseFloat(Math.round(pricelist[1] * 100) / 100).toFixed(2); </text> } @if(b2b){<text> document.getElementById("trade"+id).innerHTML="$"+parseFloat(Math.round(pricelist[0] * 100) / 100).toFixed(2); document.getElementById("priceperbottle"+id).innerHTML = "$"+ Math.round(parseFloat(pricelist[6]) * 100.0) / 100.0; </text> } } </script> <div class="productlist @ColumnsMD col-sm-6 @ColumnsXS" style="min-height:250px;margin-bottom:15px;"> <div class="boxproduct wp-block product" style="padding:15px 10px;float:left;width:100%;"> <div class="listproductright"> <a href="@GroupLink" title="@Name"> <figure style="border-bottom: 1px solid #E0EDED;" class="productfigure"> <img class="rotate90" alt="" src="/Admin/Public/Getimage.ashx?width=180&amp;height=180&amp;compression=85&amp;Crop=5&amp;image=@Image" /> </figure> </a> </div> <div> <p hidden id="discountFlag@(pid)" class="ribbon base"> <span> Buy @product.GetString("MinimumQuantity") get </span> <span> @product.GetString("Percentage") % discount. </span> </p> </div> <div class="extracolumn listproductleft wp-block-footer" style="min-height: 200px;"> <div name="productDes" id="productDes"> <span class="product-title" style="font-size:12px;"> <a href="@GroupLink"> <span class="product-brand"> @Brand </span><br /> <span class="product-name"> @Name @Vintage</span> </a> </span> <br /> <span class="product-country"> @country - @region @if(@subregion!="-"){ <text>- @subregion </text>} </span> <br/> <div name="longdescription"> <span hidden name="longdes"> @WrapMethods.Truncate(@product.GetString("Ecom:Product.LongDescription"),150).Replace("...","_") <a href="@GroupLink"><b>&nbsp;read more...</b></a></span><br /> <span name="winestyles" class="sub_title"> @wineStyle ( @volume.Replace(",","") ) </span> </div> </div> @{ var priceid = "price" + pid; } <div class="sub_title1" > @if(b2b) { <span class="productprice price"><strong id='@pid'></strong></span> } else{ <span class="productprice price"><strong id='online@(pid)'></strong></span> } <span>&nbsp;(incl. GST)</span><br/> @if (Discount != Price) { if(b2b){<text>Trade Price:</text>} <span class="productprice price"> <strong>@Discount</strong></span><span>&nbsp;(incl. GST)</span> <span class="productoldprice price " style="margin-top: 0px !important; padding-top: 0px !important;position: absolute; text-decoration: line-through;">( @Price )</span> } else { if(b2b) { if(!staff){<text>Trade Price:</text>}else{<text>Staff Price:</text>} <span class="productprice price sub_notitle error"><span id="trade@(pid)"></span></span><span>&nbsp;(excl. GST)</span> <p style="margin:0px"><text id="priceperbottlelabel@(pid)" hidden>Price per bottle:</text> <span class="productprice price"> <strong hidden id='priceperbottle@(pid)'></strong></span></p> } } </div> <p id="winerating"><span name="winestyles" class="sub_title">@wineRating</span></p> </div> @if (Discount != Price) { <span class="ribbon base">@Translate("On sale!", "On sale!")</span> @*if (@Pageview.Area.Item["EcommerceStickerType"].ToString() == "ribbon") { <span class="ribbon base">@Translate("On sale!", "On sale!")</span> } if (@Pageview.Area.Item["EcommerceStickerType"].ToString() == "ball") { <span class="ball">@Translate("On sale!", "On sale!")</span> }*@ } <div class="addtocart" style="min-height:105px;border-top:1px solid #BBBBBB;"> @{ var discountPString =""; if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductDiscount"))){ discountPString = product.GetString("Ecom:Product:Field.ProductDiscount"); } string[] discountstring = discountPString.Split('|'); var discountslist = new List<String>(); var quantitylist = new List<String>(); for(int i=0; i < discountstring.Length - 1; i++){ string[] discountsArray = discountstring[i].Split(':'); var percentage = discountsArray[1]; var quantity = discountsArray[2]; if(quantity == "0"){ quantity ="1"; } discountslist.Add(percentage); quantitylist.Add(quantity); } var stockRelation =""; if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.StockRelationship"))){ stockRelation = product.GetString("Ecom:Product:Field.StockRelationship"); } var stockPString = ""; if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.OnlinePrice"))){ stockPString = product.GetString("Ecom:Product:Field.SaleStock"); } var stockstring = stockPString.Split('|'); var stocklist = new List<int>(); for(int i=0; i < stockstring.Length - 1; i++){ string[] stockArray = stockstring[i].Split(':'); stocklist.Add(Int32.Parse(stockArray[1])); } <text> <script> </script> </text> var onlinePString = product.GetString("Ecom:Product:Field.OnlinePrice.Value"); var retailPString = product.GetString("Ecom:Product:Field.ProductRetailPrice.Value"); if((!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.OnlinePrice"))) && (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductRetailPrice")))){ var basePString = ""; if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductBasePrice"))){ basePString = product.GetString("Ecom:Product:Field.ProductBasePrice.Value"); } string[] basestring = basePString.Split('|'); var basePrice = new List<String>(); for(int i=0; i < basestring.Length - 1; i++){ string[] baseArray = basestring[i].Split(':'); basePrice.Add(baseArray[1]); } var campaignPString =""; if(!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductCampaign.Value"))){ campaignPString = product.GetString("Ecom:Product:Field.ProductCampaign.Value"); } string[] campaignstring = campaignPString.Split('|'); var campaignNo = new List<String>(); var campaignDate = new List<String>(); var campaignPercent = new List<String>(); var campaignQuantity = new List<String>(); for(int i=0; i < campaignstring.Length - 1; i++){ string[] campaignArray = campaignstring[i].Split(':'); campaignNo.Add(campaignArray[1]); if (campaignArray[2]!="0"){ var dateString = campaignArray[2].Split('/'); var date = dateString[1]+"/"+dateString[0]+"/"+dateString[2]; campaignDate.Add(date); } else{ campaignDate.Add(campaignArray[2]); } campaignPercent.Add(campaignArray[4]); campaignQuantity.Add(campaignArray[5]); } string[] onlinestring = onlinePString.Split('|'); string[] retailstring = retailPString.Split('|'); var prices = new List<String>(); var units = new List<String>(); var pricesretail = new List<String>(); var unitsretail = new List<String>(); for(int i=0; i < retailstring.Length - 1; i++){ string[] pricesArrayretail = retailstring[i].Split(':'); var pricewithdollar1 = pricesArrayretail[1]; pricesretail.Add(pricewithdollar1); unitsretail.Add(pricesArrayretail[0]); } for(int i=0; i < onlinestring.Length - 1; i++){ string[] pricesArray = onlinestring[i].Split(':'); var pricewithdollar = pricesArray[1]; prices.Add(pricewithdollar); units.Add(pricesArray[0]); } bool loopExist = true; var outofstock =false; if(@stocklist[0] <=0){ outofstock = true; } if ((@Offer=="Pre-arrival offer")||@stocklist[0] >0) { <input @Hidden id="quantityinput@(pid)" data-maxstock = "@stocklist.Max()" data-uom = "@units[0]" data-stockrelation = "@stockRelation" onchange="changeLinkquantity(this.value, this, '@pid');" type="number" name="Quantity" value="1" class="qtyBox" min="1" max="@stocklist[0]" style="width:50px;margin:10px 1px 10px -20px;border-radius:5px;padding:2px;border:2px solid #BF3E38;text-align:right;" /> <select style="width:80px;margin:10px 1px;padding:2px;border-radius:5px;border:2px solid #BF3E38;text-align:right;" id="unitID@(pid)" name="UnitID1" onchange="newPrice(this.value, '@pid');changeLink(this, '@pid');changeCampaign(this.value, '@pid',this.options[this.selectedIndex].innerHTML);"> @for(var i =0; i< prices.Count; i++){ if (i==0){ <option selected data-unit="@units[i]" value='@prices[i]|@pricesretail[i]|@campaignNo[i]|@campaignDate[i]|@discountslist[i]|@quantitylist[i]|@basePrice[i]|@stocklist[i]|@pid'>@units[i].First().ToString().ToUpper()@(units[i].Substring(1).ToLower())</option> } else{ <option data-unit="@units[i]" value='@prices[i]|@pricesretail[i]|@campaignNo[i]|@campaignDate[i]|@discountslist[i]|@quantitylist[i]|@basePrice[i]|@stocklist[i]|@pid'>@units[i].First().ToString().ToUpper()@(units[i].Substring(1).ToLower())</option> } } </select> <script> var totalquantity = 0; var select = document.getElementById("unitID"+productid); var link1 = document.getElementById("addtocart@(pid)"); var variantnamedefault = "@units[0]"; var defaultprice = '@prices[0] | @pricesretail[0]'; var defaultquantity ="1"; var productid = "@pid"; var linkstring = ""; var quantityvalue = ""; var unitvalue = ""; var selectedindex = ""; var currentuom = ""; newPrice(defaultprice, productid); function changeLink(select,id){ @if (@Offer!="Pre-arrival offer"){<text> selectedindex = select.selectedIndex; @if(b2b){<text> if (parseInt(selectedindex)>0){ revealprice(id); } else{ hideprice(id); } </text> } link1 = document.getElementById("addtocart"+id); link1.removeAttribute("disabled"); unitvalue = select.getElementsByTagName('option')[select.selectedIndex].text.toUpperCase(); quantityvalue = document.getElementById("quantityinput"+id).value; if (select==null){ unitvalue = variantnamedefault; } linkstring='/default.aspx?ID=496&productid='+id+'&VariantId='+unitvalue+'&cartcmd=add&quantity='+quantityvalue; link1.setAttribute("href",linkstring); var optionvalue = select.getElementsByTagName('option')[select.selectedIndex].value.split('|'); var inputbox = document.getElementById("quantityinput"+id); inputbox.max = optionvalue[7]; currentuom = unitvalue; var inputjq = jQuery(inputbox); $(inputjq).data('uom',unitvalue); </text> } } function changeLinkquantity(quantity1, input, id){ var inputjq = jQuery(input); currentuom = $(inputjq).data('uom'); var defaultuomstock =$(inputjq).data('maxstock'); var link2 = document.getElementById("addtocart"+id); link2.removeAttribute("disabled"); var link = link2.href; var temp = link.split('quantity='); var stockrelationjs = $(inputjq).data('stockrelation'); if (typeof(Storage) != "undefined") { // Store localStorage.setItem("stockrelation"+id, stockrelationjs+";"+defaultuomstock); } else { document.getElementById("result").innerHTML = "Sorry, Please use another browser!"; } var orderstocks = $(inputjq).data('stockcontrol'); if(orderstocks != null){ var currentstockrelation = ""; var currentuomorderstock = ""; var relationlist = stockrelationjs.split("|"); for(var i = 0; i<relationlist.length; i++){ var relationsplit = relationlist[i].split(":"); if (relationsplit[0]==currentuom){ currentstockrelation = relationsplit[1]; } } var ordertotalquantity = 0; var orderstocklist = orderstocks.split("|"); for (var i =0; i< orderstocklist.length-1;i++){ var ordersplit = orderstocklist[i].split(":"); for(var j = 0; j<relationlist.length-1; j++){ var relationsplit = relationlist[j].split(":"); if(ordersplit[1]==relationsplit[0]){ ordertotalquantity += parseInt(ordersplit[0])*parseInt(relationsplit[1]); } } } var totalquantity = ordertotalquantity+(parseInt(quantity1)*currentstockrelation); var currenttotal = parseInt(input.max)*parseInt(currentstockrelation); if(totalquantity <= defaultuomstock){ link = (temp[0]+"quantity="+ quantity1); link2.href = link; return true; } else{ alert("Exceeded Maximum Stock!"); input.value = 1; link = (temp[0]+"quantity="+ 1); link2.href = link; return false; } } else { if (parseInt(quantity1) <= parseInt(input.max)){ link = (temp[0]+"quantity="+ quantity1); link2.href = link; return true; } else{ alert("Maximum allowed quantity for this product is "+input.max); input.value = input.max; link = (temp[0]+"quantity="+ input.max); link2.href = link; return false; } } } function checkquantity(addtocartlink, id){ var input2 = document.getElementById("quantityinput"+id); var quantity2 = document.getElementById("quantityinput"+id).value; if(changeLinkquantity(quantity2, input2, id)==false){ addtocartlink.setAttribute("disabled",""); return false; } else{ addtocartlink.removeAttribute("disabled"); return true; } } function firsttimeLink (){ @if("Pre-arrival offer"!=@Offer){ <text> var firstSelect = document.getElementById("unitID"+productid); var firstUnit = firstSelect.getElementsByTagName('option')[firstSelect.selectedIndex].text.toUpperCase(); var firstLink = '/default.aspx?ID=@GetString("Ecom:Product.PrimaryOrCurrentPageID")&productid='+productid+'&VariantId='+firstUnit+'&cartcmd=add&quantity=1'; var link3 = document.getElementById("addtocart"+productid); link3.setAttribute("href",firstLink); </text> } var firstOption = select.getElementsByTagName('option')[select.selectedIndex].value; var firstValueList = firstOption.split('|'); if(firstValueList[2]!=0){ document.getElementById("test"+firstValueList[8]).innerHTML = "Now on offer until: "+firstValueList[3]+"<br> Campaign No: "+firstValueList[2]; } if(firstValueList[5]!=0){ var flag = document.getElementById("discountFlag"+firstValueList[8]); flag.removeAttribute("hidden"); flag.getElementsByTagName("span")[0].innerHTML = "Buy "+firstValueList[5]+" "+ select.getElementsByTagName('option')[select.selectedIndex].text; flag.getElementsByTagName("span")[1].innerHTML =" get "+ firstValueList[4]+"% discount"; } } </script> if("Pre-arrival offer"!=@Offer){ <text> <a href='/default.aspx?ID=496&productid=@pid&VariantId=BOTTLE&cartcmd=add&quantity=1' onclick="return checkquantity(this,'@pid')" id="addtocart@(pid)" class="btn btn-sm btn-two" style="padding-bottom:2px;margin-bottom:2px;"><i class="glyphicon glyphicon-shopping-cart" title="@Translate("Add to cart","Add to cart")"></i></a> <script> $( document ).ready(function() { select = document.getElementById("unitID"+productid); link1 = document.getElementById("addtocart"+productid); variantnamedefault = "@units[0]"; defaultprice = "@prices[0]" defaultquantity ="1"; productid = "@pid"; linkstring = ""; firsttimeLink (); }); </script> </text> } else{ <text> @if(@discountslist[0]!=""){ <script> $( document ).ready(function() { select = document.getElementById("unitID"+productid); //link1 = document.getElementById("addtocart"+productid); variantnamedefault = "@units[0]"; defaultprice = "@prices[0]" defaultquantity ="1"; productid = "@pid"; linkstring = ""; firsttimeLink (); }); </script> } <a href="@GroupLink" class="btn btn-sm btn-two" style="padding-bottom:2px;margin-bottom:2px;">More Detail</a> </text> } } else { <p class="ribbon base"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sold Out&nbsp;&nbsp;&nbsp;&nbsp;</span></p> <button type="submit" style="font-size:12px;text-decoration: line-through;display:none" class="btn btn-two" > <i class="glyphicon glyphicon-shopping-cart" title="@Translate("Add to cart","Add to cart")"></i></button> } if (Dynamicweb.Input.FormatBoolean(GetGlobalValue("Global:Extranet.UserName"))&&("Pre-arrival offer"!=@Offer)) { <a onclick='AddToFavorites("@favLink","@pid")' class="add-fav tooltipHere" style="top:inherit;right:inherit;margin-top:8px;float:right;@if(outofstock){<text>display:none</text>}" data-toggle="tooltip"> <i id="gly_@pid" class="glyphicon glyphicon-heart"></i> <i id="gid_@pid" class="glyphicon glyphicon-heart" style="display:none;color:#a73c4a !important"></i> <img id="img_@pid" src="Files/Images/TOT/favloading.gif" style="display:none;margin-bottom:6px;width:20px;height:20px;"> </a> } } <div id="campaign@(pid)" class="text_info" style="min-height:39px;"> <p id="test@(pid)"></p> </div> } <script> //Set min discount qty $(document).ready(function(){ var tagIsExist = (document.getElementById("unitID"+"@(pid)"))!==null; if(tagIsExist) { var minDiscountQty = (((document.getElementById("unitID"+"@(pid)")).getElementsByTagName('option')[(document.getElementById("unitID"+"@(pid)")).selectedIndex].value).split('|')[5]); if(minDiscountQty < 1) { minDiscountQty = 1 } $('#quantityinput@(pid)').val(minDiscountQty); } }); $('#unitID@(pid)').change(function(){ var minDiscountQty = (((document.getElementById("unitID"+"@(pid)")).getElementsByTagName('option')[(document.getElementById("unitID"+"@(pid)")).selectedIndex].value).split('|')[5]); if(minDiscountQty < 1) { minDiscountQty = 1 } $('#quantityinput@(pid)').val(minDiscountQty); }); </script> </div> </div> </div> Count++; if (Count == ColMD) { <div name="row3" class="row"></div> Count = 0; } else if (Count == 4){ <div hidden name="row4" class="row"></div> } } } <script> function changeCampaign(value, id, unit) { var valuelist = value.split('|'); if (valuelist[4]!=0) { var flag = document.getElementById("discountFlag"+id); flag.removeAttribute("hidden"); flag.getElementsByTagName("span")[0].innerHTML = "Buy "+valuelist[5]+" "+unit; flag.getElementsByTagName("span")[1].innerHTML = " get "+valuelist[4]+"% discount"; document.getElementById("test"+id).innerHTML = ""; if(valuelist[2]!=0) { var string1 = "Now on offer until: "+valuelist[3]+"<br> Campaign No: "+valuelist[2]; document.getElementById("test"+id).innerHTML = string1; } } else { var flag = document.getElementById("discountFlag"+id); flag.setAttribute("hidden",""); document.getElementById("test"+id).innerHTML = ""; } } </script> @{ string image = ""; var grouplink = ""; string productname = ""; var pid = GetValue("Ecom:Product.ID"); } <script type="text/javascript"> /* CLASSES */ function VariantGroup(id, name) { this.Id = id; this.Name = name; this.Options = []; } function VariantOption(id, name) { this.Id = id; this.Name = name; } function VariantCombination(id) { this.Id = id; } function VariantSelector() { this.Groups = []; this.Combinations = []; } /* FUNCTIONS */ function ByGroupOrder(varid) { var vars = []; for (g = 0; g < Selector.Groups.length; g++) { for (o = 0; o < Selector.Groups[g].Options.length; o++) { for (v = 0; v < varid.length; v++) { if (Selector.Groups[g].Options[o].Id == varid[v]) { vars.push(varid[v]); } } } } return vars; } function PresetCombo(combono, value) { document.getElementById('COMBO' + combono).value = value; UpdateCombo(combono); } function CombinationExist(query) { found = false; for (ci = 0; ci < Selector.Combinations.length; ci++) { combis = Selector.Combinations[ci].Id.split("."); queryfoundincombination = true; for (q = 0; q < query.length; q++) { queryitemfoundincombination = false; for (cs = 0; cs < combis.length; cs++) { if (combis[cs] == query[q]) queryitemfoundincombination = true; } if (!queryitemfoundincombination) queryfoundincombination = false; } if (queryfoundincombination) found = true; } return found; } function FillCombo(combono) { ClearCombo(combono); @{ var selectiontext = @Translate("Choose variant", "Choose variant"); } var op = document.createElement("option"); op.text = "@selectiontext"; op.value = ""; document.getElementById('COMBO' + combono).options.add(op); for (i = 0; i < Selector.Groups[combono].Options.length; i++) { option = Selector.Groups[combono].Options[i]; includeoption = true; curcombination = []; for (g = 0; g < combono; g++) { curcombination.push(document.getElementById('COMBO' + g).value); } curcombination.push(option.Id); includeoption = CombinationExist(curcombination); if (includeoption) { var op = document.createElement("option"); op.text = option.Name; op.value = option.Id; document.getElementById('COMBO' + combono).options.add(op); document.getElementById('COMBO' + combono).disabled = false; } } } function ClearCombo(combono) { while (document.getElementById('COMBO' + combono).options.length > 0) { document.getElementById('COMBO' + combono).options[0] = null; } document.getElementById('COMBO' + combono).disabled = true; } function UpdateCombo(combono) { if (combono < Selector.Groups.length - 1) { if (document.getElementById('COMBO' + combono).value != "") FillCombo((combono + 1)); if (combono > -1) { fromcombo = (document.getElementById('COMBO' + combono).value == "") ? combono + 1 : combono + 2; for (c = fromcombo; c < Selector.Groups.length; c++) { ClearCombo(c); } } } else { if (!presetting && (document.getElementById('COMBO' + (Selector.Groups.length - 1)).value != "")) { id = ""; for (c = 0; c < Selector.Groups.length; c++) { id += (c == 0) ? document.getElementById('COMBO' + c).value : "." + document.getElementById('COMBO' + c).value; } document.location.href = Page + "&VariantID=" + id; //Spinner var opts = { lines: 9, // The number of lines to draw length: 0, // The length of each line width: 10, // The line thickness radius: 18, // The radius of the inner circle corners: 1, // Corner roundness (0..1) rotate: 0, // The rotation offset direction: 1, // 1: clockwise, -1: counterclockwise color: '#000', // #rgb or #rrggbb or array of colors speed: 1, // Rounds per second trail: 35, // Afterglow percentage shadow: false, // Whether to render a shadow hwaccel: false, // Whether to use hardware acceleration className: 'spinner', // The CSS class to assign to the spinner zIndex: 2e9, // The z-index (defaults to 2000000000) top: '50%', // Top position relative to parent left: '50%' // Left position relative to parent }; var target = document.getElementById('productinfo'); var spinner = new Spinner(opts).spin(target); } } } function UpdateCart() { document.getElementById('minipagecart').className = " dw-minicart-update"; document.getElementById('minipagecart-button').className = "btn btn-sm dw-minicart-update"; } </script> @{ string imagesize = ""; string infosize = ""; switch(Pageview.Area.Item["EcommerceProductcardImageSize"].ToString()) { case "small": imagesize = "4"; infosize = "8"; break; case "medium": imagesize = "6"; infosize = "6"; break; case "large": imagesize = "12"; infosize = "12"; break; } } <div class="col-md-12 col-sm-12 col-xs-12"> <div class="row container product"> <div class="col-md-@imagesize col-sm-12 col-xs-12"> <div class="product-gallery"> <!-- Discount sticker --> @if (GetString("Ecom:Product.Discount.Price") != GetString("Ecom:Product.Price")) { if (@Pageview.Area.Item["EcommerceStickerType"].ToString() == "ribbon") { <span class="ribbon base">@Translate("On sale!", "On sale!")</span> } if (@Pageview.Area.Item["EcommerceStickerType"].ToString() == "ball") { <span class="ball">@Translate("On sale!", "On sale!")</span> } } @{ image = System.Web.HttpContext.Current.Server.UrlEncode(GetString("Ecom:Product.ImageLarge.Default.Clean")); } <div class="col-xs-12 col-sm-4 primary-image "> <a href="@image" class="fancybox"> <img src="@image" class="img-responsive" alt="Product image"> </a> </div> <div>&nbsp;</div> <div class="row"> @foreach (LoopItem detail in GetLoop("Details")) { image = System.Web.HttpContext.Current.Server.UrlEncode(detail.GetString("Ecom:Product:Detail.Image.Clean")); <div class="col-md-3 col-sm-4 col-xs-12"> <div class="thumbnail-images"> <a href="@image" class="fancybox"> <img src="@image" alt=""> </a> </div> </div> } </div> </div> </div> <div class="col-md-@infosize col-sm-12 col-xs-12"> <form name="@pid" id="@pid" method="post" action="/Default.aspx"> @GetValue("Ecom:Product.Form.Clean") <div class="product-info" vocab="http://schema.org/" typeof="Product" id="productinfo"> <h1><span property="name">@GetString("Ecom:Product.Name")</span> @GetString("Ecom:Product.SelectedVariantComboName")</h1> <span class="clearfix"></span> <div property="description" id="description"> @GetString("Ecom:Product.ShortDescription") </div> <span class="clearfix"></span> <!-- DYNAMIC VARIANT OPTION --> <div id="productvariants"> <!-- SELECTOR MAIN --> @{ var pageid = GetValue("Ecom:Product:Page.ID"); var productid = GetValue("Ecom:Product.ID"); } <script type="text/javascript"> var presetting = true; var VariantID = "@GetValue("Ecom:Product.SelectedVariantComboID")"; var VariantOptions = VariantID.split('.'); var Page = "/Default.aspx?ID=@pageid&ProductID=@productid"; var Selector = new VariantSelector(); </script> <script type="text/javascript"> @foreach (LoopItem variantgroup in GetLoop("VariantGroups")) { var variantgroupid = variantgroup.GetValue("Ecom:VariantGroup.ID"); var variantgroupname = variantgroup.GetString("Ecom:VariantGroup.Name"); <text>group = new VariantGroup("@variantgroupid", "@variantgroupname");</text> foreach (LoopItem variantoption in variantgroup.GetLoop("VariantOptions")) { var variantoptionid = variantoption.GetValue("Ecom:VariantOption.ID"); var variantoptionname = variantoption.GetString("Ecom:VariantOption.Name"); <text>group.Options.push(new VariantOption("@variantoptionid", "@variantoptionname"));</text> } <text>Selector.Groups.push(group);</text> } </script> <script type="text/javascript"> @foreach (LoopItem variantcomb in GetLoop("VariantCombinations")) { var variantcombid = variantcomb.GetValue("Ecom:VariantCombination.VariantID"); <text>Selector.Combinations.push(new VariantCombination("@variantcombid"));</text> } </script> <script type="text/javascript"> for (g = 0; g < Selector.Groups.length; g++) { document.write("<br><b>" + Selector.Groups[g].Name + "</b><br>"); document.write("<select id='COMBO" + g + "' style='width:40%' onchange=\"UpdateCombo(" + g + ");\">\n</select><br>\n"); } FillCombo(0); for (vo = 0; vo < VariantOptions.length; vo++) { PresetCombo(vo, VariantOptions[vo]); } presetting = false; </script> </div> <hr/> <div property="offers" typeof="Offer"> <div class="row"> <span class="clearfix"></span> <div class="product-short-info"> @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Product:Stock.Text"))) { image = GetString("Ecom:Product:Stock.Image.Clean"); <div class="col-md-6 col-xs-12"> <p><small>@Translate("Availability", "Availability"): <span property="availability">@GetString("Ecom:Product:Stock.Text")</span>: </small><img src="@image" alt="@GetString("ecom:product:stock.text")" style="width:7px !important; height:7px !important" /></p> </div> <div class="col-md-6 col-xs-12"> <p><small>@Translate("Delivery", "Delivery"): @GetString("Ecom:Product:Stock.DeliveryText")&nbsp;@GetString("Ecom:Product:Stock.DeliveryUnit")</small></p> </div> } <div class="col-md-6 col-xs-12"> <p><small>@Translate("Product number", "Product number"): <span property="identifier">@GetString("Ecom:Product.Number")</span></small></p> </div> @if (GetLoop("BOMProducts").Count > 0){ <div class="col-md-12 col-xs-12" id="includingproducts"> <hr/> <h3 class="section-title">@Translate("Including products", "Including products")</h3> @foreach (LoopItem bomproduct in GetLoop("BOMProducts")){ var bomimage = bomproduct.GetString("Ecom:Product.ImageSmall.Clean"); <ul> <li class="bomlist"><a href="@bomproduct.GetString("Ecom:Product.Link.Clean.PID")"> <img src="/Admin/Public/GetImage.ashx?width=50&amp;image=@bomimage&amp;Compression=99" alt=""> <text>&nbsp;&nbsp;&nbsp;</text>@bomproduct.GetString("Ecom:Product.Name") </a></li> </ul> } <table cellspacing="0" cellpadding="0" border="0"> @foreach (LoopItem bomconfig in GetLoop("BOMConfigurators")){ <tr> <td> <b>@bomconfig.GetString("Ecom:Product.Configurator.Name")</b><br> <select name="@bomconfig.GetString("Ecom:Product.Configurator.ID")"> @foreach (LoopItem configproduct in GetLoop("ConfiguratorProducts")){ <option value="@configproduct.GetString("Ecom:Product.ID")" @configproduct.GetString("Ecom:Product.Configurator.Selected") > @configproduct.GetString("Ecom:Product.Name") ( @configproduct.GetString("Ecom:Product.ActualPrice")" ) </option> } </select> </td> </tr> } </table> </div> } </div> </div> <hr/> <div class="row"> <div class="col-md-12 col-xs-12"> @{ var currency = GetString("Ecom:Product.Price.Currency.Code"); } <meta property="priceCurrency" content="@currency" /> @if (GetString("Ecom:Product.Discount.Price") != GetString("Ecom:Product.Price")) { <span class="price pull-left" style="font-size: 28px !important" property="price"> @GetString("Ecom:Product.Discount.Price") </span> <span>&nbsp;&nbsp;</span> <p style="margin-top: 0px !important; padding-top: 10px !important; color: #AAAAAA !important; font-size: 12px !important; position: absolute; text-decoration: line-through"> <strong>@GetString("Ecom:Product.Price")</strong> <!-- @GetString("Ecom:Product.Discount.TotalPercentWithVATFormatted") --> </p> } else { <span class="price pull-left" style="font-size: 28px !important; margin-top:4px !important" property="price"> @GetString("Ecom:Product.Discount.Price") </span> } <button type="submit" name="submit" onclick="UpdateCart();" class="btn btn-dw-cart pull-right"><strong>@Translate("Add to cart", "Add to cart")</strong></button> <input type="number" name="Quantity" value="1" class="pull-right" style="width:60px; text-align:center; margin-right:15px !important; height:34px;"> </div> </div> <hr/> </div> </div> </form> </div> @if(Dynamicweb.Base.IsModuleInstalled("LoyaltyPoints")) { @* Buy with loyalty points start *@ var productPoints = GetDouble("Ecom:Product.PointPrice"); <div class="col-md-6 col-sm-12 col-xs-12"> @if (productPoints > 0) { <span class="price pull-left" style="font-size: 22px !important; margin-top:4px !important">@productPoints @Translate("Points", "Points")</span> var user = Dynamicweb.Modules.UserManagement.User.get_Current(Dynamicweb.Modules.UserManagement.PagePermissionLevels.Frontend); if (user == null) { <div class="alert alert-info">@Translate("Sign in to buy this product using points")</div> } else { var availablePoints = user != null ? user.PointBalance : 0; var cart = Dynamicweb.eCommerce.Common.Context.Cart; var pointsUsedInCart = cart != null ? cart.TotalPoints : 0; if (availablePoints < productPoints + pointsUsedInCart) { <div class="alert alert-danger">@string.Format(Translate("You don't have enough points to buy this product using points ({0:0.00}/{1:0.00})"), availablePoints, productPoints + pointsUsedInCart)</div> } else { var ProductID = GetValue("Ecom:Product.ID"); <form method="post" role="form"> <input type="hidden" name="ProductID" value="@ProductID" /> <button type="submit" onclick="UpdateCart();" class="btn btn-dw-secondary pull-right" name="CartCmd" value="addWithPoints">@Translate("Buy for") @productPoints @Translate("points")</button> </form> } } } </div> <div class="col-md-6 col-sm-12 col-xs-12"> <hr/> </div> @* Buy with loyalty points end *@ } </div> <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <h2>@Translate("Description", "Description")</h2> <p> @GetString("Ecom:Product.LongDescription") </p> </div> </div> <div class="row"><hr/></div> <!-- RELATED PRODUCTS --> @if (Pageview.Area.Item["RelatedProducts"].ToString() == "True"){ if (GetString("Ecom:Product.RelatedCount") != "0"){ <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <h3 class="dw-section-title"><span>@Translate("Related products", "Related products")</span></h3> </div> </div> foreach (LoopItem relatedgroup in GetLoop("ProductRelatedGroups")){ <div class="row"> @{ var relatedproductloop = relatedgroup.GetLoop("RelatedProducts").OrderByDescending(g => g.GetString("Ecom:Product.LoopCounter")).Take(3).ToList(); } @GetProductList(relatedproductloop, 3, 3, 1) </div> <div class="row"><hr/></div> } } } @if (Pageview.Area.Item["CustomersAlsoSaw"].ToString() == "True"){ if (GetString("eCom:Related.CustomersWhoSawThisAlsoSaw.Count") != "0"){ <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <h3 class="dw-section-title"><span>@Translate("Other costumers also saw", "Other costumers also saw")</span></h3> </div> </div> <div class="row"> @{ var alsoproductgroup = GetLoop("eCom:Related.CustomersWhoSawThisAlsoSaw").OrderByDescending(g => g.GetString("Ecom:Product.LoopCounter")).Take(3).ToList(); } @GetProductList(alsoproductgroup, 3, 3, 1) </div> <div class="row"><hr/></div> } } @if (Pageview.Area.Item["YourLastSeenProducts"].ToString() == "True"){ if (GetString("eCom:Related.YouHaveSeenTheseProducts.Count") != "0"){ <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <h3 class="dw-section-title"><span>@Translate("Recently viewed items", "Recently viewed items")</span></h3> </div> </div> <div class="row"> @{ var recentproductgroup = GetLoop("eCom:Related.YouHaveSeenTheseProducts").OrderByDescending(g => g.GetString("Ecom:Product.LoopCounter")).Take(3).ToList(); } @GetProductList(recentproductgroup, 3, 3, 1) </div> <div class="row"><hr/></div> } } @if (Pageview.Area.Item["ProductsFromCategory"].ToString() == "True"){ if (GetString("eCom:Related.WhatAboutTheseProducts.Count") != "0"){ <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <h3 class="dw-section-title"><span>@Translate("Other great products in the same category", "Other great products in the same category")</span></h3> </div> </div> <div class="row"> @{ var aboutproductgroup = GetLoop("eCom:Related.WhatAboutTheseProducts").OrderByDescending(g => g.GetString("Ecom:Product.LoopCounter")).Take(3).ToList(); } @GetProductList(aboutproductgroup, 3, 3, 1) </div> <div class="row"><hr/></div> } } <div class="row"><div class="col-md-12 col-sm-12 col-xs-12">&nbsp;</div></div> </div> </div> </div> </div>