

- Ampoule LED [G150] à filament globe Ø15 / Verre ambré
Art.nr.
Error compiling template "/Designs/Swift/Paragraph/Custom_Swift_ProductAddToCart.cshtml" Line 601: } expected Line 601: } expected Line 524: The name 'variantSelectorServicePageId' does not exist in the current context Line 536: The name 'variantId' does not exist in the current context Line 552: The name 'ButtonShape' does not exist in the current context Line 556: The name 'buttonAspectRatio' does not exist in the current context Line 560: The name 'variantSelectorServicePageId' does not exist in the current context Line 585: The name 'buttonText' does not exist in the current context
1 // <auto-generated/> 2 #pragma warning disable 1591 3 namespace CompiledRazorTemplates.Dynamic 4 { 5 #line hidden 6 using System.Threading.Tasks; 7 using System; 8 using System.Collections.Generic; 9 using System.Linq; 10 using Dynamicweb.Ecommerce.ProductCatalog; 11 using Dynamicweb.Core.Encoders; 12 using System.Globalization; 13 internal class RazorEngine_6634edfd3c7f42a7a87345908b986e09 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 14 { 15 #pragma warning disable 1998 16 public async override global::System.Threading.Tasks.Task ExecuteAsync() 17 { 18 WriteLiteral("\r\n"); 19 WriteLiteral("\r\n"); 20 21 ProductViewModel product = null; 22 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 23 { 24 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 25 } 26 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 27 { 28 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 29 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 30 31 if (productList?.Products is object) 32 { 33 product = productList.Products[0]; 34 } 35 } 36 37 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", ""); 38 bool anonymousUser = Pageview.User == null; 39 bool isErpConnectionDown = !Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsWebServiceConnectionAvailable"]); 40 bool hideAddToCart = anonymousUsersLimitations.Contains("cart") && anonymousUser || Pageview.AreaSettings.GetBoolean("ErpDownHideAddToCart") && isErpConnectionDown; 41 hideAddToCart = Pageview.IsVisualEditorMode ? false : hideAddToCart; 42 WriteLiteral("\r\n"); 43 if (product is object && !hideAddToCart) 44 { 45 string horizontalAlign = Model.Item.GetRawValueString("HorizontalAlignment", ""); 46 horizontalAlign = horizontalAlign == "center" ? "justify-content-center" : horizontalAlign; 47 horizontalAlign = horizontalAlign == "end" ? "justify-content-end" : horizontalAlign; 48 horizontalAlign = horizontalAlign == "full" ? "" : horizontalAlign; 49 50 bool favoritesSelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowAddToFavorites")) ? Model.Item.GetBoolean("ShowAddToFavorites") : false; 51 bool quantitySelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowQuantitySelector")) ? Model.Item.GetBoolean("ShowQuantitySelector") : false; 52 bool unitsSelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowUnitsSelector")) ? Model.Item.GetBoolean("ShowUnitsSelector") : false; 53 bool hideInventory = !string.IsNullOrEmpty(Model.Item.GetString("HideInventory")) ? Model.Item.GetBoolean("HideInventory") : false; 54 bool hideStockState = !string.IsNullOrEmpty(Model.Item.GetString("HideStockState")) ? Model.Item.GetBoolean("HideStockState") : false; 55 56 string buttonSize = Model.Item.GetRawValueString("ButtonSize", "regular"); 57 string inputSize = string.Empty; 58 59 switch (buttonSize) 60 { 61 case "small": 62 inputSize = " input-group-sm"; 63 buttonSize = " btn-sm"; 64 break; 65 case "regular": 66 buttonSize = string.Empty; 67 break; 68 case "large": 69 inputSize = " input-group-lg"; 70 buttonSize = " btn-lg"; 71 break; 72 } 73 74 string iconPath = "/Files/icons/"; 75 string url = "/Default.aspx?ID=" + (GetPageIdByNavigationTag("CartService")); 76 if (!url.Contains("LayoutTemplate")) 77 { 78 url += url.Contains("?") ? "&LayoutTemplate=Swift_MiniCart.cshtml" : "?LayoutTemplate=Swift_MiniCart.cshtml"; 79 } 80 81 string whenVariantsExist = Model.Item.GetRawValueString("WhenVariantsExist", "hide"); 82 string flexFill = Model.Item.GetRawValueString("HorizontalAlignment", "") == "full" ? "flex-fill" : ""; 83 string fullWidth = Model.Item.GetRawValueString("HorizontalAlignment", "") == "full" ? "w-100" : ""; 84 string addToCartIcon = Model.Item.GetRawValueString("Icon", iconPath + "shopping-cart.svg"); 85 string addToCartLabel = !addToCartIcon.Contains("_none") ? $"<span class=\"icon-2\">{ReadFile(addToCartIcon)}</span>" : ""; 86 addToCartLabel += !addToCartIcon.Contains("_none") && !Model.Item.GetBoolean("HideButtonText") ? " " : ""; 87 addToCartLabel += !Model.Item.GetBoolean("HideButtonText") ? $"<span class=\"d-none d-md-inline\">{Translate("Add to cart")}</span><span class=\"d-inline d-md-none\">{Translate("Add")}</span>" : ""; 88 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]); 89 90 bool userHasPendingQuote = Dynamicweb.Ecommerce.Common.Context.Cart != null && Dynamicweb.Ecommerce.Common.Context.Cart.IsQuote; 91 92 if (product.VariantInfo.VariantInfo == null || whenVariantsExist == "disable") 93 { 94 string unitId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.Form.Get("UnitId")) ? Dynamicweb.Context.Current.Request.Form.Get("UnitId") : product.DefaultUnitId; 95 if (string.IsNullOrEmpty(unitId) && product?.UnitOptions != null) 96 { 97 if (product.UnitOptions.FirstOrDefault<UnitOptionViewModel>() != null) 98 { 99 unitId = product.UnitOptions.FirstOrDefault<UnitOptionViewModel>().Id; 100 } 101 } 102 103 double? stepQty = product.PurchaseQuantityStep > 0 ? product.PurchaseQuantityStep : 1; 104 double? minQty = product.PurchaseMinimumQuantity > 0 ? product.PurchaseMinimumQuantity : 1; 105 double? valueQty = minQty > stepQty ? minQty : stepQty; 106 string disableAddToCart = null; 107 double? maxQty = null; 108 109 if (product.ProductType == Dynamicweb.Ecommerce.Products.ProductType.Stock && !product.NeverOutOfstock) 110 { 111 disableAddToCart = (product.StockLevel <= 0) || (!product.NeverOutOfstock && isLazyLoadingForProductInfoEnabled) ? "disabled" : disableAddToCart; 112 maxQty = product.StockLevel; 113 } 114 115 disableAddToCart = whenVariantsExist == "disable" && product.VariantInfo.VariantInfo != null && string.IsNullOrEmpty(product.VariantId) ? "disabled" : disableAddToCart; 116 disableAddToCart = product.Discontinued ? "disabled" : disableAddToCart; 117 118 if (unitsSelector && product.UnitOptions.Count > 0) 119 { 120 WriteLiteral("\t\t\t<form method=\"post\""); 121 BeginWriteAttribute("action", " action=\"", 5913, "\"", 5980, 4); 122 WriteAttributeValue("", 5922, "/Default.aspx?ID=", 5922, 17, true); 123 WriteAttributeValue("", 5939, Pageview.Page.ID, 5939, 19, false); 124 WriteAttributeValue("", 5958, "&ProductId=", 5958, 11, true); 125 WriteAttributeValue("", 5969, product.Id, 5969, 11, false); 126 EndWriteAttribute(); 127 BeginWriteAttribute("id", " id=\"", 5981, "\"", 6065, 6); 128 WriteAttributeValue("", 5986, "UnitSelectorForm_", 5986, 17, true); 129 WriteAttributeValue("", 6003, product.Id, 6003, 13, false); 130 WriteAttributeValue("", 6016, "_", 6016, 1, true); 131 WriteAttributeValue("", 6017, product.VariantId.Replace(".", "_"), 6017, 38, false); 132 WriteAttributeValue("", 6055, "_", 6055, 1, true); 133 WriteAttributeValue("", 6056, Model.ID, 6056, 9, false); 134 EndWriteAttribute(); 135 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"redirect\" value=\"false\">\r\n\t\t\t\t<input type=\"hidden\" name=\"VariantID\""); 136 BeginWriteAttribute("value", " value=\"", 6167, "\"", 6193, 1); 137 WriteAttributeValue("", 6175, product.VariantId, 6175, 18, false); 138 EndWriteAttribute(); 139 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"UnitID\" class=\"js-unit-id\""); 140 BeginWriteAttribute("value", " value=\"", 6254, "\"", 6269, 1); 141 WriteAttributeValue("", 6262, unitId, 6262, 7, false); 142 EndWriteAttribute(); 143 WriteLiteral(">\r\n\t\t\t</form>\r\n"); 144 } 145 146 WriteLiteral("\t\t<div"); 147 BeginWriteAttribute("class", " class=\"", 6298, "\"", 6393, 6); 148 WriteAttributeValue("", 6306, "d-flex", 6306, 6, true); 149 WriteAttributeValue(" ", 6312, horizontalAlign, 6313, 16, false); 150 WriteAttributeValue(" ", 6329, fullWidth, 6330, 10, false); 151 WriteAttributeValue(" ", 6340, "js-input-group", 6341, 15, true); 152 WriteAttributeValue(" ", 6355, "item_", 6356, 6, true); 153 WriteAttributeValue("", 6361, Model.Item.SystemName.ToLower(), 6361, 32, false); 154 EndWriteAttribute(); 155 WriteLiteral(">\r\n"); 156 if (!anonymousUser && favoritesSelector) 157 { 158 Write(RenderPartial("Components/ToggleFavorite.cshtml", product)); 159 160 } 161 WriteLiteral("\r\n\t\t\t<form method=\"post\""); 162 BeginWriteAttribute("action", " action=\"", 6544, "\"", 6557, 1); 163 WriteAttributeValue("", 6553, url, 6553, 4, false); 164 EndWriteAttribute(); 165 BeginWriteAttribute("class", " class=\"", 6558, "\"", 6576, 1); 166 WriteAttributeValue("", 6566, fullWidth, 6566, 10, false); 167 EndWriteAttribute(); 168 WriteLiteral(" style=\"z-index: 1\">\r\n\t\t\t\t<input type=\"hidden\" name=\"redirect\" value=\"false\">\r\n\t\t\t\t<input type=\"hidden\" name=\"ProductId\""); 169 BeginWriteAttribute("value", " value=\"", 6697, "\"", 6716, 1); 170 WriteAttributeValue("", 6705, product.Id, 6705, 11, false); 171 EndWriteAttribute(); 172 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"ProductName\""); 173 BeginWriteAttribute("value", " value=\"", 6763, "\"", 6808, 1); 174 WriteAttributeValue("", 6771, HtmlEncoder.HtmlEncode(product.Name), 6771, 37, false); 175 EndWriteAttribute(); 176 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"ProductVariantName\""); 177 BeginWriteAttribute("value", " value=\"", 6862, "\"", 6890, 1); 178 WriteAttributeValue("", 6870, product.VariantName, 6870, 20, false); 179 EndWriteAttribute(); 180 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"ProductCurrency\""); 181 BeginWriteAttribute("value", " value=\"", 6941, "\"", 6999, 1); 182 WriteAttributeValue("", 6949, Dynamicweb.Ecommerce.Common.Context.Currency.Code, 6949, 50, false); 183 EndWriteAttribute(); 184 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"ProductPrice\""); 185 BeginWriteAttribute("value", " value=\"", 7047, "\"", 7089, 1); 186 WriteAttributeValue("", 7055, product.Price.ToStringInvariant(), 7055, 34, false); 187 EndWriteAttribute(); 188 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"ProductDiscount\""); 189 BeginWriteAttribute("value", " value=\"", 7140, "\"", 7185, 1); 190 WriteAttributeValue("", 7148, product.Discount.ToStringInvariant(), 7148, 37, false); 191 EndWriteAttribute(); 192 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"ProductReferer\" value=\"component_ProductAddToCart\">\r\n\t\t\t\t<input type=\"hidden\" name=\"cartcmd\" value=\"add\">\r\n\t\t\t\t<input type=\"submit\" class=\"d-none\" onclick=\"event.preventDefault(); swift.Cart.Update(event)\"> "); 193 WriteLiteral("\r\n\r\n"); 194 if (!string.IsNullOrEmpty(product.VariantId)) 195 { 196 WriteLiteral("\t\t\t\t\t<input type=\"hidden\" name=\"VariantId\""); 197 BeginWriteAttribute("value", " value=\"", 7591, "\"", 7617, 1); 198 WriteAttributeValue("", 7599, product.VariantId, 7599, 18, false); 199 EndWriteAttribute(); 200 WriteLiteral(">\r\n"); 201 } 202 WriteLiteral("\r\n\t\t\t\t<template class=\"js-step-quantity-warning\">\r\n\t\t\t\t\t<div class=\"modal-header\">\r\n\t\t\t\t\t\t<h1 class=\"modal-title fs-5\">"); 203 Write(Translate("The quantity is not valid")); 204 WriteLiteral("</h1>\r\n\t\t\t\t\t\t<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"modal-body\">\r\n\t\t\t\t\t\t"); 205 Write(Translate("Please select a quantity that is dividable by")); 206 WriteLiteral(" "); 207 Write(stepQty); 208 WriteLiteral("\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</template>\r\n\r\n\r\n\t\t\t\t<template class=\"js-min-quantity-warning\">\r\n\t\t\t\t\t<div class=\"modal-header\">\r\n\t\t\t\t\t\t<h1 class=\"modal-title fs-5\">"); 209 Write(Translate("The product could not be added to the cart")); 210 WriteLiteral("</h1>\r\n\t\t\t\t\t\t<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"modal-body\">\r\n\t\t\t\t\t\t"); 211 Write(Translate("The quantity is not valid. You must buy at least")); 212 WriteLiteral(" "); 213 Write(product.PurchaseMinimumQuantity); 214 WriteLiteral("\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</template>\r\n\r\n\t\t\t\t<template class=\"js-value-missing-warning\">\r\n\t\t\t\t\t<div class=\"modal-header\">\r\n\t\t\t\t\t\t<h1 class=\"modal-title fs-5\">"); 215 Write(Translate("No amount specified")); 216 WriteLiteral("</h1>\r\n\t\t\t\t\t\t<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"modal-body\">\r\n\t\t\t\t\t\t"); 217 Write(Translate("Specify an amount to add to the cart")); 218 WriteLiteral("\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</template>\r\n\r\n\r\n"); 219 if (userHasPendingQuote) 220 { 221 WriteLiteral("\t\t\t\t\t<input type=\"hidden\" name=\"PendingQuote\" value=\"true\">\r\n"); 222 WriteLiteral("\t\t\t\t\t<template class=\"js-pending-quote-notice\">\r\n\t\t\t\t\t\t<div class=\"modal-header\">\r\n\t\t\t\t\t\t\t<h1 class=\"modal-title fs-5\">"); 223 Write(Translate("Pending Quote")); 224 WriteLiteral("</h1>\r\n\t\t\t\t\t\t\t<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\""); 225 BeginWriteAttribute("aria-label", " aria-label=\"", 9222, "\"", 9254, 1); 226 WriteAttributeValue("", 9235, Translate("Close"), 9235, 19, false); 227 EndWriteAttribute(); 228 WriteLiteral("></button>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"modal-body\">\r\n\t\t\t\t\t\t\t"); 229 Write(Translate("You need to complete your current quote or empty the cart before adding this product to cart.")); 230 WriteLiteral("\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</template>\r\n"); 231 } 232 WriteLiteral("\r\n"); 233 if (quantitySelector || (!anonymousUser && product.VariantInfo.VariantInfo != null) || (!anonymousUser && favoritesSelector)) 234 { 235 WriteLiteral("\t\t\t\t\t<input type=\"hidden\""); 236 BeginWriteAttribute("id", " id=\"", 9634, "\"", 9694, 4); 237 WriteAttributeValue("", 9639, "Unit_", 9639, 5, true); 238 WriteAttributeValue("", 9644, product.Id, 9644, 13, false); 239 WriteAttributeValue("", 9657, "_", 9657, 1, true); 240 WriteAttributeValue("", 9658, product.VariantId.Replace(".", "_"), 9658, 36, false); 241 EndWriteAttribute(); 242 WriteLiteral(" name=\"UnitID\""); 243 BeginWriteAttribute("value", " value=\"", 9709, "\"", 9724, 1); 244 WriteAttributeValue("", 9717, unitId, 9717, 7, false); 245 EndWriteAttribute(); 246 WriteLiteral(" />\r\n"); 247 } 248 WriteLiteral("\r\n\t\t\t\t<div class=\"d-flex flex-row w-100\">\r\n"); 249 if (!quantitySelector) 250 { 251 WriteLiteral("\t\t\t\t\t\t<input"); 252 BeginWriteAttribute("id", " id=\"", 9830, "\"", 9894, 4); 253 WriteAttributeValue("", 9835, "Quantity_", 9835, 9, true); 254 WriteAttributeValue("", 9844, product.Id, 9844, 13, false); 255 WriteAttributeValue("", 9857, "_", 9857, 1, true); 256 WriteAttributeValue("", 9858, product.VariantId.Replace(".", "_"), 9858, 36, false); 257 EndWriteAttribute(); 258 WriteLiteral(" class=\"swift_quantity_field\" name=\"Quantity\""); 259 BeginWriteAttribute("value", " value=\"", 9940, "\"", 9957, 1); 260 WriteAttributeValue("", 9948, valueQty, 9948, 9, false); 261 EndWriteAttribute(); 262 WriteLiteral(" type=\"hidden\" "); 263 Write(disableAddToCart); 264 WriteLiteral(">\r\n"); 265 } 266 WriteLiteral("\r\n"); 267 if (unitsSelector && product.UnitOptions.Count > 0) 268 { 269 string selectedUnitName = !string.IsNullOrEmpty(unitId) && product?.UnitOptions != null ? unitId : product.UnitOptions.FirstOrDefault<UnitOptionViewModel>().Name; 270 271 foreach (var unitOption in product.UnitOptions) 272 { 273 if (unitOption.Id == unitId) 274 { 275 selectedUnitName = unitOption.Name; 276 } 277 } 278 279 WriteLiteral("\t\t\t\t\t\t<div class=\"d-flex flex-column gap-2 w-100\">\r\n\t\t\t\t\t\t\t<div"); 280 BeginWriteAttribute("class", " class=\"", 10482, "\"", 10552, 4); 281 WriteAttributeValue("", 10490, "input-group", 10490, 11, true); 282 WriteAttributeValue(" ", 10501, "input-primary-button-group", 10502, 27, true); 283 WriteAttributeValue(" ", 10528, "flex-nowrap", 10529, 12, true); 284 WriteAttributeValue("", 10540, inputSize, 10540, 12, false); 285 EndWriteAttribute(); 286 WriteLiteral(">\r\n\r\n"); 287 if (quantitySelector) 288 { 289 290 WriteLiteral("\t\t\t\t\t\t\t\t\t<input"); 291 BeginWriteAttribute("id", " id=\"", 10618, "\"", 10682, 4); 292 WriteAttributeValue("", 10623, "Quantity_", 10623, 9, true); 293 WriteAttributeValue("", 10632, product.Id, 10632, 13, false); 294 WriteAttributeValue("", 10645, "_", 10645, 1, true); 295 WriteAttributeValue("", 10646, product.VariantId.Replace(".", "_"), 10646, 36, false); 296 EndWriteAttribute(); 297 WriteLiteral(" name=\"Quantity\""); 298 BeginWriteAttribute("value", " value=\"", 10699, "\"", 10732, 1); 299 WriteAttributeValue("", 10707, DoubleToString(valueQty), 10707, 25, false); 300 EndWriteAttribute(); 301 BeginWriteAttribute("step", " step=\"", 10733, "\"", 10764, 1); 302 WriteAttributeValue("", 10740, DoubleToString(stepQty), 10740, 24, false); 303 EndWriteAttribute(); 304 BeginWriteAttribute("min", " min=\"", 10765, "\"", 10794, 1); 305 WriteAttributeValue("", 10771, DoubleToString(minQty), 10771, 23, false); 306 EndWriteAttribute(); 307 WriteLiteral(" max=\"700\" class=\"form-control swift_quantity-field\" style=\"min-width: 60px; max-width: 100px; z-index: 1\" maxlength=\"3\" type=\"number\" "); 308 Write(disableAddToCart); 309 WriteLiteral(" oninput=\"if(this.value.length>3) this.value = this.value.slice(0,3);\">\r\n"); 310 } 311 WriteLiteral("\r\n\t\t\t\t\t\t\t\t<button"); 312 BeginWriteAttribute("class", " class=\"", 11048, "\"", 11099, 4); 313 WriteAttributeValue("", 11056, "btn", 11056, 3, true); 314 WriteAttributeValue(" ", 11059, "btn-secondary", 11060, 14, true); 315 WriteAttributeValue(" ", 11073, flexFill, 11074, 9, false); 316 WriteAttributeValue(" ", 11083, "dropdown-toggle", 11084, 16, true); 317 EndWriteAttribute(); 318 WriteLiteral(" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\r\n\t\t\t\t\t\t\t\t\t"); 319 Write(selectedUnitName); 320 WriteLiteral("\r\n\t\t\t\t\t\t\t\t</button>\r\n\r\n\t\t\t\t\t\t\t\t<ul class=\"dropdown-menu swift_unit-field\">\r\n"); 321 foreach (var unitOption in product.UnitOptions) 322 { 323 var selectedUnit = unitOption.Id == unitId ? "selected" : ""; 324 325 WriteLiteral("\t\t\t\t\t\t\t\t\t\t<li>\r\n\t\t\t\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn dropdown-item\" data-value=\""); 326 Write(unitOption.Id); 327 WriteLiteral("\""); 328 BeginWriteAttribute("onclick", " onclick=\"", 11515, "\"", 12012, 23); 329 WriteAttributeValue("", 11525, "document.querySelector(\'#UnitSelectorForm_", 11525, 42, true); 330 WriteAttributeValue("", 11567, product.Id, 11567, 13, false); 331 WriteAttributeValue("", 11580, "_", 11580, 1, true); 332 WriteAttributeValue("", 11581, product.VariantId.Replace(".", "_"), 11581, 38, false); 333 WriteAttributeValue("", 11619, "_", 11619, 1, true); 334 WriteAttributeValue("", 11620, Model.ID, 11620, 9, false); 335 WriteAttributeValue("", 11629, "\').querySelector(\'.js-unit-id\').value", 11629, 37, true); 336 WriteAttributeValue(" ", 11666, "=", 11667, 2, true); 337 WriteAttributeValue(" ", 11668, "this.getAttribute(\'data-value\');", 11669, 33, true); 338 WriteAttributeValue("\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t", 11701, "document.querySelector(\'#Unit_", 11729, 58, true); 339 WriteAttributeValue("", 11759, product.Id, 11759, 13, false); 340 WriteAttributeValue("", 11772, "_", 11772, 1, true); 341 WriteAttributeValue("", 11773, product.VariantId.Replace(".", "_"), 11773, 36, false); 342 WriteAttributeValue("", 11809, "\').value", 11809, 8, true); 343 WriteAttributeValue(" ", 11817, "=", 11818, 2, true); 344 WriteAttributeValue(" ", 11819, "this.getAttribute(\'data-value\');", 11820, 33, true); 345 WriteAttributeValue("\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t", 11852, "swift.PageUpdater.Update(document.querySelector(\'#UnitSelectorForm_", 11880, 95, true); 346 WriteAttributeValue("", 11947, product.Id, 11947, 13, false); 347 WriteAttributeValue("", 11960, "_", 11960, 1, true); 348 WriteAttributeValue("", 11961, product.VariantId.Replace(".", "_"), 11961, 38, false); 349 WriteAttributeValue("", 11999, "_", 11999, 1, true); 350 WriteAttributeValue("", 12000, Model.ID, 12000, 9, false); 351 WriteAttributeValue("", 12009, "\'))", 12009, 3, true); 352 EndWriteAttribute(); 353 WriteLiteral(">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<span>"); 354 Write(unitOption.Name); 355 WriteLiteral("</span>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<span>\r\n"); 356 if (unitOption.StockLevel > 0 || unitOption.NeverOutOfStock) 357 { 358 if (!Model.Item.GetBoolean("HideInventory") && !unitOption.NeverOutOfStock) 359 { 360 WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"small text-success\">"); 361 Write(unitOption.StockLevel); 362 WriteLiteral(" "); 363 Write(Translate("In stock")); 364 WriteLiteral("</span>\r\n"); 365 } 366 else 367 { 368 WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"small text-success\">"); 369 Write(Translate("In stock")); 370 WriteLiteral("</span>\r\n"); 371 } 372 } 373 else 374 { 375 WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"small text-danger\">"); 376 Write(Translate("Out of Stock")); 377 WriteLiteral("</span>\r\n"); 378 } 379 WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t\t\t\t\t</li>\r\n"); 380 } 381 WriteLiteral("\t\t\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<button type=\"button\" onclick=\"swift.Cart.Update(event)\""); 382 BeginWriteAttribute("class", " class=\"", 12844, "\"", 12903, 4); 383 WriteAttributeValue("", 12852, "btn", 12852, 3, true); 384 WriteAttributeValue(" ", 12855, "btn-primary", 12856, 12, true); 385 WriteAttributeValue(" ", 12867, buttonSize, 12868, 13, false); 386 WriteAttributeValue(" ", 12881, "js-add-to-cart-button", 12882, 22, true); 387 EndWriteAttribute(); 388 WriteLiteral(" style=\"white-space: nowrap\" "); 389 Write(disableAddToCart); 390 WriteLiteral(" title=\""); 391 Write(Translate("Add to cart")); 392 WriteLiteral("\" id=\"AddToCartButton"); 393 Write(product.Id); 394 WriteLiteral("_"); 395 Write(Pageview.CurrentParagraph.ID); 396 WriteLiteral("\">\r\n"); 397 if (!Model.Item.GetBoolean("HideButtonText")) 398 { 399 WriteLiteral("\t\t\t\t\t\t\t\t\t<span class=\"text-nowrap d-flex align-items-center justify-content-center gap-2\">\r\n\t\t\t\t\t\t\t\t\t\t"); 400 Write(addToCartLabel); 401 WriteLiteral("\r\n\t\t\t\t\t\t\t\t\t</span>\r\n"); 402 } 403 else 404 { 405 Write(addToCartLabel); 406 407 } 408 WriteLiteral("\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t</div>\r\n"); 409 } 410 else 411 { 412 WriteLiteral("\t\t\t\t\t\t<div"); 413 BeginWriteAttribute("class", " class=\"", 13397, "\"", 13467, 4); 414 WriteAttributeValue("", 13405, "input-group", 13405, 11, true); 415 WriteAttributeValue(" ", 13416, "input-primary-button-group", 13417, 27, true); 416 WriteAttributeValue(" ", 13443, "flex-nowrap", 13444, 12, true); 417 WriteAttributeValue("", 13455, inputSize, 13455, 12, false); 418 EndWriteAttribute(); 419 WriteLiteral(">\r\n"); 420 if (quantitySelector) 421 { 422 WriteLiteral("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<AUTO GENERATED BY CONFLICT EXTENSION<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< staging\r\n\t\t\t\t\t\t\t\t<input"); 423 BeginWriteAttribute("id", " id=\"", 13644, "\"", 13708, 4); 424 WriteAttributeValue("", 13649, "Quantity_", 13649, 9, true); 425 WriteAttributeValue("", 13658, product.Id, 13658, 13, false); 426 WriteAttributeValue("", 13671, "_", 13671, 1, true); 427 WriteAttributeValue("", 13672, product.VariantId.Replace(".", "_"), 13672, 36, false); 428 EndWriteAttribute(); 429 WriteLiteral(" name=\"Quantity\""); 430 BeginWriteAttribute("value", " value=\"", 13725, "\"", 13758, 1); 431 WriteAttributeValue("", 13733, DoubleToString(valueQty), 13733, 25, false); 432 EndWriteAttribute(); 433 BeginWriteAttribute("step", " step=\"", 13759, "\"", 13790, 1); 434 WriteAttributeValue("", 13766, DoubleToString(stepQty), 13766, 24, false); 435 EndWriteAttribute(); 436 BeginWriteAttribute("min", " min=\"", 13791, "\"", 13820, 1); 437 WriteAttributeValue("", 13797, DoubleToString(minQty), 13797, 23, false); 438 EndWriteAttribute(); 439 WriteLiteral(" max=\"700\" class=\"form-control swift_quantity-field\" style=\"min-width: 60px; max-width: 100px; z-index: 1\" maxlength=\"3\" type=\"number\" "); 440 Write(disableAddToCart); 441 WriteLiteral(">\r\n====================================AUTO GENERATED BY CONFLICT EXTENSION====================================\r\n\t\t\t\t\t\t\t\t<input"); 442 BeginWriteAttribute("id", " id=\"", 14100, "\"", 14164, 4); 443 WriteAttributeValue("", 14105, "Quantity_", 14105, 9, true); 444 WriteAttributeValue("", 14114, product.Id, 14114, 13, false); 445 WriteAttributeValue("", 14127, "_", 14127, 1, true); 446 WriteAttributeValue("", 14128, product.VariantId.Replace(".", "_"), 14128, 36, false); 447 EndWriteAttribute(); 448 WriteLiteral(" name=\"Quantity\""); 449 BeginWriteAttribute("value", " value=\"", 14181, "\"", 14214, 1); 450 WriteAttributeValue("", 14189, DoubleToString(valueQty), 14189, 25, false); 451 EndWriteAttribute(); 452 BeginWriteAttribute("step", " step=\"", 14215, "\"", 14246, 1); 453 WriteAttributeValue("", 14222, DoubleToString(stepQty), 14222, 24, false); 454 EndWriteAttribute(); 455 BeginWriteAttribute("min", " min=\"", 14247, "\"", 14276, 1); 456 WriteAttributeValue("", 14253, DoubleToString(minQty), 14253, 23, false); 457 EndWriteAttribute(); 458 WriteLiteral(" max=\"700\" class=\"form-control swift_quantity-field\" style=\"min-width: 60px; max-width: 100px; z-index: 1\" maxlength=\"3\" type=\"number\" "); 459 Write(disableAddToCart); 460 WriteLiteral(@" oninput=""if(this.value.length>3) this.value = this.value.slice(0,3);""> 461 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>AUTO GENERATED BY CONFLICT EXTENSION>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> features/Reduce-size-'add-to-cart'-PLP-PDP 462 } 463 464 <button type=""button"" onclick=""swift.Cart.Update(event)"""); 465 BeginWriteAttribute("class", " class=\"", 14730, "\"", 14799, 5); 466 WriteAttributeValue("", 14738, "btn", 14738, 3, true); 467 WriteAttributeValue(" ", 14741, "btn-primary", 14742, 12, true); 468 WriteAttributeValue(" ", 14753, buttonSize, 14754, 13, false); 469 WriteAttributeValue(" ", 14767, flexFill, 14768, 9, false); 470 WriteAttributeValue(" ", 14777, "js-add-to-cart-button", 14778, 22, true); 471 EndWriteAttribute(); 472 WriteLiteral(" style=\"white-space: nowrap\" "); 473 Write(disableAddToCart); 474 WriteLiteral(" title=\""); 475 Write(Translate("Add to cart")); 476 WriteLiteral("\" id=\"AddToCartButton"); 477 Write(product.Id); 478 WriteLiteral("_"); 479 Write(Pageview.CurrentParagraph.ID); 480 WriteLiteral("\">\r\n"); 481 if (!Model.Item.GetBoolean("HideButtonText")) 482 { 483 WriteLiteral("\t\t\t\t\t\t\t\t\t<span class=\"text-nowrap d-flex align-items-center justify-content-center gap-2\">\r\n\t\t\t\t\t\t\t\t\t\t"); 484 Write(addToCartLabel); 485 WriteLiteral("\r\n\t\t\t\t\t\t\t\t\t</span>\r\n"); 486 } 487 else 488 { 489 Write(addToCartLabel); 490 491 } 492 WriteLiteral("\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t</div>\r\n"); 493 } 494 WriteLiteral("\t\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t</div>\r\n"); 495 } 496 WriteLiteral(@" else if (whenVariantsExist == ""modal"") 497 { 498 string ButtonShape = Model.Item.GetRawValueString(""VariantButtonShape"", ""square""); 499 string buttonAspectRatio = Model.Item.GetRawValueString(""VariantImageAspectRatio"", ""56%""); 500 501 string buttonText = Translate(""Select""); 502 string variantId = !string.IsNullOrWhiteSpace(product.VariantId) ? product.VariantId : product.DefaultVariantId; 503 504 string variantSelectorServicePageId = !string.IsNullOrEmpty(Model.Item.GetString(""VariantSelectorServicePageId"")) ? Model.Item.GetLink(""VariantSelectorServicePageId"").PageId.ToString() : """"; 505 variantSelectorServicePageId = variantSelectorServicePageId != """" ? variantSelectorServicePageId : GetPageIdByNavigationTag(""VariantSelectorService"").ToString(); 506 507 <div"); 508 BeginWriteAttribute("class", " class=\"", 16058, "\"", 16133, 5); 509 WriteAttributeValue("", 16066, "d-flex", 16066, 6, true); 510 WriteAttributeValue(" ", 16072, horizontalAlign, 16073, 16, false); 511 WriteAttributeValue(" ", 16089, "w-100", 16090, 6, true); 512 WriteAttributeValue(" ", 16095, "item_", 16096, 6, true); 513 WriteAttributeValue("", 16101, Model.Item.SystemName.ToLower(), 16101, 32, false); 514 EndWriteAttribute(); 515 WriteLiteral(">\r\n"); 516 if (!anonymousUser && favoritesSelector) 517 { 518 Write(RenderPartial("Components/ToggleFavorite.cshtml", product)); 519 520 } 521 WriteLiteral("\t\t\t<form"); 522 BeginWriteAttribute("action", " action=\"", 16268, "\"", 16323, 2); 523 WriteAttributeValue("", 16277, "/Default.aspx?ID=", 16277, 17, true); 524 WriteAttributeValue("", 16294, variantSelectorServicePageId, 16294, 29, false); 525 EndWriteAttribute(); 526 WriteLiteral(" data-response-target-element=\"DynamicModalContent\" data-preloader=\"inline\" style=\"z-index: 1\""); 527 BeginWriteAttribute("class", " class=\"", 16418, "\"", 16436, 1); 528 WriteAttributeValue("", 16426, fullWidth, 16426, 10, false); 529 EndWriteAttribute(); 530 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"ProductID\""); 531 BeginWriteAttribute("value", " value=\"", 16481, "\"", 16500, 1); 532 WriteAttributeValue("", 16489, product.Id, 16489, 11, false); 533 EndWriteAttribute(); 534 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"VariantID\""); 535 BeginWriteAttribute("value", " value=\"", 16545, "\"", 16563, 1); 536 WriteAttributeValue("", 16553, variantId, 16553, 10, false); 537 EndWriteAttribute(); 538 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"QuantitySelector\""); 539 BeginWriteAttribute("value", " value=\"", 16615, "\"", 16651, 1); 540 WriteAttributeValue("", 16623, quantitySelector.ToString(), 16623, 28, false); 541 EndWriteAttribute(); 542 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"HideInventory\""); 543 BeginWriteAttribute("value", " value=\"", 16700, "\"", 16733, 1); 544 WriteAttributeValue("", 16708, hideInventory.ToString(), 16708, 25, false); 545 EndWriteAttribute(); 546 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"HideStockState\""); 547 BeginWriteAttribute("value", " value=\"", 16783, "\"", 16817, 1); 548 WriteAttributeValue("", 16791, hideStockState.ToString(), 16791, 26, false); 549 EndWriteAttribute(); 550 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"ButtonLayout\""); 551 BeginWriteAttribute("value", " value=\"", 16865, "\"", 16885, 1); 552 WriteAttributeValue("", 16873, ButtonShape, 16873, 12, false); 553 EndWriteAttribute(); 554 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"ButtonAspectRatio\""); 555 BeginWriteAttribute("value", " value=\"", 16938, "\"", 16964, 1); 556 WriteAttributeValue("", 16946, buttonAspectRatio, 16946, 18, false); 557 EndWriteAttribute(); 558 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"VariantSelectorServicePage\""); 559 BeginWriteAttribute("value", " value=\"", 17026, "\"", 17063, 1); 560 WriteAttributeValue("", 17034, variantSelectorServicePageId, 17034, 29, false); 561 EndWriteAttribute(); 562 WriteLiteral(">\r\n\t\t\t\t<input type=\"hidden\" name=\"ViewType\" value=\"ModalContent\">\r\n"); 563 if (isLazyLoadingForProductInfoEnabled) 564 { 565 WriteLiteral("\t\t\t\t\t<input type=\"hidden\" name=\"getproductinfo\" value=\"true\">\r\n"); 566 } 567 WriteLiteral("\t\t\t\t<button type=\"button\" onclick=\"swift.PageUpdater.Update(event)\""); 568 BeginWriteAttribute("class", " class=\"", 17455, "\"", 17502, 4); 569 WriteAttributeValue("", 17463, "btn", 17463, 3, true); 570 WriteAttributeValue(" ", 17466, "btn-primary", 17467, 12, true); 571 WriteAttributeValue("", 17478, buttonSize, 17478, 13, false); 572 WriteAttributeValue(" ", 17491, fullWidth, 17492, 10, false); 573 EndWriteAttribute(); 574 BeginWriteAttribute("title", " title=\"", 17503, "\"", 17531, 1); 575 WriteAttributeValue("", 17511, Translate("Select"), 17511, 20, false); 576 EndWriteAttribute(); 577 WriteLiteral(" data-bs-toggle=\"modal\" data-bs-target=\"#DynamicModal\""); 578 BeginWriteAttribute("id", " id=\"", 17586, "\"", 17658, 4); 579 WriteAttributeValue("", 17591, "OpenVariantSelectorModal", 17591, 24, true); 580 WriteAttributeValue("", 17615, product.Id, 17615, 13, false); 581 WriteAttributeValue("", 17628, "_", 17628, 1, true); 582 WriteAttributeValue("", 17629, Pageview.CurrentParagraph.ID, 17629, 29, false); 583 EndWriteAttribute(); 584 WriteLiteral(">"); 585 Write(buttonText); 586 WriteLiteral("</button>\r\n\t\t\t</form>\r\n\t\t</div>\r\n\t}\r\n}\r\nelse if (Pageview.IsVisualEditorMode)\r\n{\r\n\t<div class=\"alert alert-dark m-0\">"); 587 Write(Translate("No products available")); 588 WriteLiteral("</div>\r\n}\r\n<script>\r\n\tdocument.querySelectorAll(\'input[name=\"Quantity\"]\').forEach(function(input) {\r\n\t input.addEventListener(\'input\', function() {\r\n\t\tif (this.value.length > 3) {\r\n\t\t this.value = this.value.slice(0, 3);\r\n\t\t}\r\n\t });\r\n\t});\r\n</script>"); 589 } 590 #pragma warning restore 1998 591 592 string DoubleToString(double? value) 593 { 594 if (value.HasValue) 595 { 596 return value.Value.ToString(CultureInfo.InvariantCulture); 597 } 598 return null; 599 } 600 } 601 } 602 #pragma warning restore 1591 603
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Ecommerce.ProductCatalog 3 @using Dynamicweb.Core.Encoders 4 @using System.Globalization 5 6 @functions { 7 string DoubleToString(double? value) 8 { 9 if (value.HasValue) 10 { 11 return value.Value.ToString(CultureInfo.InvariantCulture); 12 } 13 return null; 14 } 15 } 16 17 @{ 18 ProductViewModel product = null; 19 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 20 { 21 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 22 } 23 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 24 { 25 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 26 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 27 28 if (productList?.Products is object) 29 { 30 product = productList.Products[0]; 31 } 32 } 33 34 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", ""); 35 bool anonymousUser = Pageview.User == null; 36 bool isErpConnectionDown = !Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsWebServiceConnectionAvailable"]); 37 bool hideAddToCart = anonymousUsersLimitations.Contains("cart") && anonymousUser || Pageview.AreaSettings.GetBoolean("ErpDownHideAddToCart") && isErpConnectionDown; 38 hideAddToCart = Pageview.IsVisualEditorMode ? false : hideAddToCart; 39 } 40 41 @if (product is object && !hideAddToCart) 42 { 43 string horizontalAlign = Model.Item.GetRawValueString("HorizontalAlignment", ""); 44 horizontalAlign = horizontalAlign == "center" ? "justify-content-center" : horizontalAlign; 45 horizontalAlign = horizontalAlign == "end" ? "justify-content-end" : horizontalAlign; 46 horizontalAlign = horizontalAlign == "full" ? "" : horizontalAlign; 47 48 bool favoritesSelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowAddToFavorites")) ? Model.Item.GetBoolean("ShowAddToFavorites") : false; 49 bool quantitySelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowQuantitySelector")) ? Model.Item.GetBoolean("ShowQuantitySelector") : false; 50 bool unitsSelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowUnitsSelector")) ? Model.Item.GetBoolean("ShowUnitsSelector") : false; 51 bool hideInventory = !string.IsNullOrEmpty(Model.Item.GetString("HideInventory")) ? Model.Item.GetBoolean("HideInventory") : false; 52 bool hideStockState = !string.IsNullOrEmpty(Model.Item.GetString("HideStockState")) ? Model.Item.GetBoolean("HideStockState") : false; 53 54 string buttonSize = Model.Item.GetRawValueString("ButtonSize", "regular"); 55 string inputSize = string.Empty; 56 57 switch (buttonSize) 58 { 59 case "small": 60 inputSize = " input-group-sm"; 61 buttonSize = " btn-sm"; 62 break; 63 case "regular": 64 buttonSize = string.Empty; 65 break; 66 case "large": 67 inputSize = " input-group-lg"; 68 buttonSize = " btn-lg"; 69 break; 70 } 71 72 string iconPath = "/Files/icons/"; 73 string url = "/Default.aspx?ID=" + (GetPageIdByNavigationTag("CartService")); 74 if (!url.Contains("LayoutTemplate")) 75 { 76 url += url.Contains("?") ? "&LayoutTemplate=Swift_MiniCart.cshtml" : "?LayoutTemplate=Swift_MiniCart.cshtml"; 77 } 78 79 string whenVariantsExist = Model.Item.GetRawValueString("WhenVariantsExist", "hide"); 80 string flexFill = Model.Item.GetRawValueString("HorizontalAlignment", "") == "full" ? "flex-fill" : ""; 81 string fullWidth = Model.Item.GetRawValueString("HorizontalAlignment", "") == "full" ? "w-100" : ""; 82 string addToCartIcon = Model.Item.GetRawValueString("Icon", iconPath + "shopping-cart.svg"); 83 string addToCartLabel = !addToCartIcon.Contains("_none") ? $"<span class=\"icon-2\">{ReadFile(addToCartIcon)}</span>" : ""; 84 addToCartLabel += !addToCartIcon.Contains("_none") && !Model.Item.GetBoolean("HideButtonText") ? " " : ""; 85 addToCartLabel += !Model.Item.GetBoolean("HideButtonText") ? $"<span class=\"d-none d-md-inline\">{Translate("Add to cart")}</span><span class=\"d-inline d-md-none\">{Translate("Add")}</span>" : ""; 86 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]); 87 88 bool userHasPendingQuote = Dynamicweb.Ecommerce.Common.Context.Cart != null && Dynamicweb.Ecommerce.Common.Context.Cart.IsQuote; 89 90 if (product.VariantInfo.VariantInfo == null || whenVariantsExist == "disable") 91 { 92 string unitId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.Form.Get("UnitId")) ? Dynamicweb.Context.Current.Request.Form.Get("UnitId") : product.DefaultUnitId; 93 if (string.IsNullOrEmpty(unitId) && product?.UnitOptions != null) 94 { 95 if (product.UnitOptions.FirstOrDefault<UnitOptionViewModel>() != null) 96 { 97 unitId = product.UnitOptions.FirstOrDefault<UnitOptionViewModel>().Id; 98 } 99 } 100 101 double? stepQty = product.PurchaseQuantityStep > 0 ? product.PurchaseQuantityStep : 1; 102 double? minQty = product.PurchaseMinimumQuantity > 0 ? product.PurchaseMinimumQuantity : 1; 103 double? valueQty = minQty > stepQty ? minQty : stepQty; 104 string disableAddToCart = null; 105 double? maxQty = null; 106 107 if (product.ProductType == Dynamicweb.Ecommerce.Products.ProductType.Stock && !product.NeverOutOfstock) 108 { 109 disableAddToCart = (product.StockLevel <= 0) || (!product.NeverOutOfstock && isLazyLoadingForProductInfoEnabled) ? "disabled" : disableAddToCart; 110 maxQty = product.StockLevel; 111 } 112 113 disableAddToCart = whenVariantsExist == "disable" && product.VariantInfo.VariantInfo != null && string.IsNullOrEmpty(product.VariantId) ? "disabled" : disableAddToCart; 114 disableAddToCart = product.Discontinued ? "disabled" : disableAddToCart; 115 116 if (unitsSelector && product.UnitOptions.Count > 0) 117 { 118 <form method="post" action="/Default.aspx?ID=@(Pageview.Page.ID)&ProductId=@product.Id" id="UnitSelectorForm_@(product.Id)_@(product.VariantId.Replace(".", "_"))_@Model.ID"> 119 <input type="hidden" name="redirect" value="false"> 120 <input type="hidden" name="VariantID" value="@product.VariantId"> 121 <input type="hidden" name="UnitID" class="js-unit-id" value="@unitId"> 122 </form> 123 } 124 125 <div class="d-flex @horizontalAlign @fullWidth js-input-group item_@Model.Item.SystemName.ToLower()"> 126 @if (!anonymousUser && favoritesSelector) 127 { 128 @RenderPartial("Components/ToggleFavorite.cshtml", product) 129 } 130 131 <form method="post" action="@url" class="@fullWidth" style="z-index: 1"> 132 <input type="hidden" name="redirect" value="false"> 133 <input type="hidden" name="ProductId" value="@product.Id"> 134 <input type="hidden" name="ProductName" value="@HtmlEncoder.HtmlEncode(product.Name)"> 135 <input type="hidden" name="ProductVariantName" value="@product.VariantName"> 136 <input type="hidden" name="ProductCurrency" value="@Dynamicweb.Ecommerce.Common.Context.Currency.Code"> 137 <input type="hidden" name="ProductPrice" value="@product.Price.ToStringInvariant()"> 138 <input type="hidden" name="ProductDiscount" value="@product.Discount.ToStringInvariant()"> 139 <input type="hidden" name="ProductReferer" value="component_ProductAddToCart"> 140 <input type="hidden" name="cartcmd" value="add"> 141 <input type="submit" class="d-none" onclick="event.preventDefault(); swift.Cart.Update(event)"> @* Fix for enterKey should not redirect to minicart page *@ 142 143 @if (!string.IsNullOrEmpty(product.VariantId)) 144 { 145 <input type="hidden" name="VariantId" value="@product.VariantId"> 146 } 147 148 <template class="js-step-quantity-warning"> 149 <div class="modal-header"> 150 <h1 class="modal-title fs-5">@Translate("The quantity is not valid")</h1> 151 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 152 </div> 153 <div class="modal-body"> 154 @Translate("Please select a quantity that is dividable by") @stepQty 155 </div> 156 </template> 157 158 159 <template class="js-min-quantity-warning"> 160 <div class="modal-header"> 161 <h1 class="modal-title fs-5">@Translate("The product could not be added to the cart")</h1> 162 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 163 </div> 164 <div class="modal-body"> 165 @Translate("The quantity is not valid. You must buy at least") @product.PurchaseMinimumQuantity 166 </div> 167 </template> 168 169 <template class="js-value-missing-warning"> 170 <div class="modal-header"> 171 <h1 class="modal-title fs-5">@Translate("No amount specified")</h1> 172 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 173 </div> 174 <div class="modal-body"> 175 @Translate("Specify an amount to add to the cart") 176 </div> 177 </template> 178 179 180 @if (userHasPendingQuote) 181 { 182 <input type="hidden" name="PendingQuote" value="true"> 183 184 <template class="js-pending-quote-notice"> 185 <div class="modal-header"> 186 <h1 class="modal-title fs-5">@Translate("Pending Quote")</h1> 187 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="@Translate("Close")"></button> 188 </div> 189 <div class="modal-body"> 190 @Translate("You need to complete your current quote or empty the cart before adding this product to cart.") 191 </div> 192 </template> 193 } 194 195 @if (quantitySelector || (!anonymousUser && product.VariantInfo.VariantInfo != null) || (!anonymousUser && favoritesSelector)) 196 { 197 <input type="hidden" id="Unit_@(product.Id)_@product.VariantId.Replace(".", "_")" name="UnitID" value="@unitId" /> 198 } 199 200 <div class="d-flex flex-row w-100"> 201 @if (!quantitySelector) 202 { 203 <input id="Quantity_@(product.Id)_@product.VariantId.Replace(".", "_")" class="swift_quantity_field" name="Quantity" value="@valueQty" type="hidden" @disableAddToCart> 204 } 205 206 @if (unitsSelector && product.UnitOptions.Count > 0) 207 { 208 string selectedUnitName = !string.IsNullOrEmpty(unitId) && product?.UnitOptions != null ? unitId : product.UnitOptions.FirstOrDefault<UnitOptionViewModel>().Name; 209 210 foreach (var unitOption in product.UnitOptions) 211 { 212 if (unitOption.Id == unitId) 213 { 214 selectedUnitName = unitOption.Name; 215 } 216 } 217 218 <div class="d-flex flex-column gap-2 w-100"> 219 <div class="input-group input-primary-button-group flex-nowrap@(inputSize)"> 220 221 @if (quantitySelector) 222 { 223 224 <input id="Quantity_@(product.Id)_@product.VariantId.Replace(".", "_")" name="Quantity" value="@DoubleToString(valueQty)" step="@DoubleToString(stepQty)" min="@DoubleToString(minQty)" max="700" class="form-control swift_quantity-field" style="min-width: 60px; max-width: 100px; z-index: 1" maxlength="3" type="number" @disableAddToCart oninput="if(this.value.length>3) this.value = this.value.slice(0,3);"> 225 } 226 227 <button class="btn btn-secondary @flexFill dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> 228 @selectedUnitName 229 </button> 230 231 <ul class="dropdown-menu swift_unit-field"> 232 @foreach (var unitOption in product.UnitOptions) 233 { 234 var selectedUnit = unitOption.Id == unitId ? "selected" : ""; 235 236 <li> 237 <button type="button" class="btn dropdown-item" data-value="@unitOption.Id" onclick="document.querySelector('#UnitSelectorForm_@(product.Id)_@(product.VariantId.Replace(".", "_"))_@Model.ID').querySelector('.js-unit-id').value = this.getAttribute('data-value'); 238 document.querySelector('#Unit_@(product.Id)_@product.VariantId.Replace(".", "_")').value = this.getAttribute('data-value'); 239 swift.PageUpdater.Update(document.querySelector('#UnitSelectorForm_@(product.Id)_@(product.VariantId.Replace(".", "_"))_@Model.ID'))"> 240 <span>@unitOption.Name</span> 241 <span> 242 @if (unitOption.StockLevel > 0 || unitOption.NeverOutOfStock) 243 { 244 if (!Model.Item.GetBoolean("HideInventory") && !unitOption.NeverOutOfStock) 245 { 246 <span class="small text-success">@unitOption.StockLevel @Translate("In stock")</span> 247 } 248 else 249 { 250 <span class="small text-success">@Translate("In stock")</span> 251 } 252 } 253 else 254 { 255 <span class="small text-danger">@Translate("Out of Stock")</span> 256 } 257 </span> 258 </button> 259 </li> 260 } 261 </ul> 262 </div> 263 <button type="button" onclick="swift.Cart.Update(event)" class="btn btn-primary @(buttonSize) js-add-to-cart-button" style="white-space: nowrap" @disableAddToCart title="@Translate("Add to cart")" id="AddToCartButton@(product.Id)_@Pageview.CurrentParagraph.ID"> 264 @if (!Model.Item.GetBoolean("HideButtonText")) 265 { 266 <span class="text-nowrap d-flex align-items-center justify-content-center gap-2"> 267 @addToCartLabel 268 </span> 269 } 270 else 271 { 272 @addToCartLabel 273 } 274 </button> 275 </div> 276 } 277 else 278 { 279 <div class="input-group input-primary-button-group flex-nowrap@(inputSize)"> 280 @if (quantitySelector) 281 { 282 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<AUTO GENERATED BY CONFLICT EXTENSION<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< staging 283 <input id="Quantity_@(product.Id)_@product.VariantId.Replace(".", "_")" name="Quantity" value="@DoubleToString(valueQty)" step="@DoubleToString(stepQty)" min="@DoubleToString(minQty)" max="700" class="form-control swift_quantity-field" style="min-width: 60px; max-width: 100px; z-index: 1" maxlength="3" type="number" @disableAddToCart> 284 ====================================AUTO GENERATED BY CONFLICT EXTENSION==================================== 285 <input id="Quantity_@(product.Id)_@product.VariantId.Replace(".", "_")" name="Quantity" value="@DoubleToString(valueQty)" step="@DoubleToString(stepQty)" min="@DoubleToString(minQty)" max="700" class="form-control swift_quantity-field" style="min-width: 60px; max-width: 100px; z-index: 1" maxlength="3" type="number" @disableAddToCart oninput="if(this.value.length>3) this.value = this.value.slice(0,3);"> 286 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>AUTO GENERATED BY CONFLICT EXTENSION>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> features/Reduce-size-'add-to-cart'-PLP-PDP 287 } 288 289 <button type="button" onclick="swift.Cart.Update(event)" class="btn btn-primary @(buttonSize) @flexFill js-add-to-cart-button" style="white-space: nowrap" @disableAddToCart title="@Translate("Add to cart")" id="AddToCartButton@(product.Id)_@Pageview.CurrentParagraph.ID"> 290 @if (!Model.Item.GetBoolean("HideButtonText")) 291 { 292 <span class="text-nowrap d-flex align-items-center justify-content-center gap-2"> 293 @addToCartLabel 294 </span> 295 } 296 else 297 { 298 @addToCartLabel 299 } 300 </button> 301 </div> 302 } 303 </div> 304 </form> 305 </div> 306 } 307 else if (whenVariantsExist == "modal") 308 { 309 string ButtonShape = Model.Item.GetRawValueString("VariantButtonShape", "square"); 310 string buttonAspectRatio = Model.Item.GetRawValueString("VariantImageAspectRatio", "56%"); 311 312 string buttonText = Translate("Select"); 313 string variantId = !string.IsNullOrWhiteSpace(product.VariantId) ? product.VariantId : product.DefaultVariantId; 314 315 string variantSelectorServicePageId = !string.IsNullOrEmpty(Model.Item.GetString("VariantSelectorServicePageId")) ? Model.Item.GetLink("VariantSelectorServicePageId").PageId.ToString() : ""; 316 variantSelectorServicePageId = variantSelectorServicePageId != "" ? variantSelectorServicePageId : GetPageIdByNavigationTag("VariantSelectorService").ToString(); 317 318 <div class="d-flex @horizontalAlign w-100 item_@Model.Item.SystemName.ToLower()"> 319 @if (!anonymousUser && favoritesSelector) 320 { 321 @RenderPartial("Components/ToggleFavorite.cshtml", product) 322 } 323 <form action="/Default.aspx?ID=@variantSelectorServicePageId" data-response-target-element="DynamicModalContent" data-preloader="inline" style="z-index: 1" class="@fullWidth"> 324 <input type="hidden" name="ProductID" value="@product.Id"> 325 <input type="hidden" name="VariantID" value="@variantId"> 326 <input type="hidden" name="QuantitySelector" value="@quantitySelector.ToString()"> 327 <input type="hidden" name="HideInventory" value="@hideInventory.ToString()"> 328 <input type="hidden" name="HideStockState" value="@hideStockState.ToString()"> 329 <input type="hidden" name="ButtonLayout" value="@ButtonShape"> 330 <input type="hidden" name="ButtonAspectRatio" value="@buttonAspectRatio"> 331 <input type="hidden" name="VariantSelectorServicePage" value="@variantSelectorServicePageId"> 332 <input type="hidden" name="ViewType" value="ModalContent"> 333 @if (isLazyLoadingForProductInfoEnabled) 334 { 335 @* If lazy loading is enabled, bypass it because we're loading a modal window, so render everything as if it was server-side *@ 336 <input type="hidden" name="getproductinfo" value="true"> 337 } 338 <button type="button" onclick="swift.PageUpdater.Update(event)" class="btn btn-primary@(buttonSize) @fullWidth" title="@Translate("Select")" data-bs-toggle="modal" data-bs-target="#DynamicModal" id="OpenVariantSelectorModal@(product.Id)_@Pageview.CurrentParagraph.ID">@buttonText</button> 339 </form> 340 </div> 341 } 342 } 343 else if (Pageview.IsVisualEditorMode) 344 { 345 <div class="alert alert-dark m-0">@Translate("No products available")</div> 346 } 347 <script> 348 document.querySelectorAll('input[name="Quantity"]').forEach(function(input) { 349 input.addEventListener('input', function() { 350 if (this.value.length > 3) { 351 this.value = this.value.slice(0, 3); 352 } 353 }); 354 }); 355 </script>
- Nom du produit
- Ampoule LED [G150] à filament globe Ø15
- Numéro d'article
- 8469/39A
- Hauteur du produit
- 0,16 m
- Largeur du produit
- 0,15 m
- Certificering
- CE/CB
- Ampoule
- LED
- Matériau de l’éclairage
- Glas
- Puissance maximale (en watts)
- 12
- AttenduLivraison
- 01/01/1900 00:00:00
- Quantité minimale d'achat
- 1
- Incrément de quantité d'achat
- 1
- Description du produit
-
Cette source lumineuse à filament LED a un verre ambré et a la forme d'une sphère d'un diamètre de 15 centimètres. Comme cette source lumineuse a une couleur de lumière de 2100K, elle fournit une lumière très chaude. La source lumineuse est dimmable.
Raccord : E27
Puissance : 12W
Couleur de lumière : 2100K
Lumen : 800 lm
- Profondeur Colli 1
- 0,08
- Colli 1 Poids brut
- 0,11
- Colli 1 hauteur
- 0,08
- Colli 1 Poids net
- 0,09
- Colli 1 Carton extérieur Qté
- 6
- Poids à vide Colli 1
- 0,02
- Colli 1 Largeur
- 0,08