Enter Password to Access This Site

Incorrect password

SK MAT

(0)

FOLINA FOOD SUPPLEMENT 60TAB

33835
PIECE
LYD 55,000 InStock

You need a prescription to purchase this product. Book an appointment with our doctors.

Error executing template "/Designs/Swift/Paragraph/Custom_Swift_ProductClickCollect.cshtml"
System.Net.WebException: An error occurred while sending the request.
 ---> System.Net.Http.HttpRequestException: An error occurred while sending the request.
 ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
 ---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
   at System.Net.Sockets.NetworkStream.Read(Span`1 buffer)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Span`1 buffer)
   at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
   at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
   at System.IO.Stream.Read(Span`1 buffer)
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpMessageInvoker.Send(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.Send(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at System.Net.HttpWebRequest.SendRequest(Boolean async)
   at System.Net.HttpWebRequest.GetResponse()
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at CustomServices.Services.DiscountService.GetCCLiveStock(String productNumber, String storeId, String unitId, String langId)
   at CompiledRazorTemplates.Dynamic.RazorEngine_0cc70e9720fd464397b1583d2f975511.ExecuteAsync()
   at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Ecommerce.ProductCatalog 3 @using Dynamicweb.Ecommerce.Products 4 @using Dynamicweb.Core.Encoders 5 @using System.Globalization 6 @using Dynamicweb.Ecommerce.Stocks; 7 @using CustomServices.Services 8 9 @functions { 10 string DoubleToString(double? value) 11 { 12 if (value.HasValue) 13 { 14 return value.Value.ToString(CultureInfo.InvariantCulture); 15 } 16 return null; 17 } 18 } 19 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 43 var currentCart = Dynamicweb.Ecommerce.Common.Context.Cart; 44 bool isClickCollect = false; 45 string CCStoreId = ""; 46 int orderlinecount = 0; 47 if (currentCart != null) 48 { 49 if (currentCart.OrderFieldValues.FirstOrDefault(x => x.OrderField.SystemName == "isClickAndCollect").Value != null) 50 { 51 if (currentCart.OrderFieldValues.FirstOrDefault(x => x.OrderField.SystemName == "isClickAndCollect").Value.ToString() != "") 52 { 53 isClickCollect = Convert.ToBoolean(currentCart.OrderFieldValues.FirstOrDefault(x => x.OrderField.SystemName == "isClickAndCollect").Value.ToString()); 54 } 55 } 56 if (currentCart.OrderFieldValues.FirstOrDefault(x => x.OrderField.SystemName == "ClickAndCollectStore").Value != null) 57 { 58 CCStoreId = currentCart.OrderFieldValues.FirstOrDefault(x => x.OrderField.SystemName == "ClickAndCollectStore").Value.ToString(); 59 } 60 if (currentCart.OrderLines != null) 61 { 62 orderlinecount = currentCart.OrderLines.CountOnlyProducts; 63 } 64 } 65 string unitId = ""; 66 } 67 68 @if (product is object && !hideAddToCart) 69 { 70 string horizontalAlign = Model.Item.GetRawValueString("HorizontalAlignment", ""); 71 horizontalAlign = horizontalAlign == "center" ? "justify-content-center" : horizontalAlign; 72 horizontalAlign = horizontalAlign == "end" ? "justify-content-end" : horizontalAlign; 73 horizontalAlign = horizontalAlign == "full" ? "" : horizontalAlign; 74 75 bool favoritesSelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowAddToFavorites")) ? Model.Item.GetBoolean("ShowAddToFavorites") : false; 76 bool quantitySelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowQuantitySelector")) ? Model.Item.GetBoolean("ShowQuantitySelector") : false; 77 bool unitsSelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowUnitsSelector")) ? Model.Item.GetBoolean("ShowUnitsSelector") : false; 78 bool hideInventory = !string.IsNullOrEmpty(Model.Item.GetString("HideInventory")) ? Model.Item.GetBoolean("HideInventory") : false; 79 bool hideStockState = !string.IsNullOrEmpty(Model.Item.GetString("HideStockState")) ? Model.Item.GetBoolean("HideStockState") : false; 80 81 string display = ""; 82 display = product.ProductType == ProductType.Service ? "d-none" : ""; 83 string buttonSize = Model.Item.GetRawValueString("ButtonSize", "regular"); 84 string inputSize = string.Empty; 85 86 switch (buttonSize) 87 { 88 case "small": 89 inputSize = " input-group-sm"; 90 buttonSize = " btn-sm"; 91 break; 92 case "regular": 93 buttonSize = string.Empty; 94 break; 95 case "large": 96 inputSize = " input-group-lg"; 97 buttonSize = " btn-lg"; 98 break; 99 } 100 101 string iconPath = "/Files/icons/"; 102 string url = "/Default.aspx?ID=" + (GetPageIdByNavigationTag("CartService")); 103 if (!url.Contains("LayoutTemplate")) 104 { 105 url += url.Contains("?") ? "&LayoutTemplate=Swift_MiniCart.cshtml" : "?LayoutTemplate=Swift_MiniCart.cshtml"; 106 } 107 108 string whenVariantsExist = Model.Item.GetRawValueString("WhenVariantsExist", "hide"); 109 string flexFill = Model.Item.GetRawValueString("HorizontalAlignment", "") == "full" ? "flex-fill" : ""; 110 string fullWidth = Model.Item.GetRawValueString("HorizontalAlignment", "") == "full" ? "w-100" : ""; 111 string addToCartIcon = Model.Item.GetRawValueString("Icon", iconPath + "shopping-cart.svg"); 112 string addToCartLabel = !addToCartIcon.Contains("_none") ? $"<span class=\"icon-2\">{ReadFile(addToCartIcon)}</span>" : ""; 113 addToCartLabel += !addToCartIcon.Contains("_none") && !Model.Item.GetBoolean("HideButtonText") ? " " : ""; 114 addToCartLabel += !Model.Item.GetBoolean("HideButtonText") ? $"<span class=\"d-none d-md-inline\">{Translate("Click and Collect")}</span><span class=\"d-inline d-md-none\">{Translate("Click and Collect")}</span>" : ""; 115 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]); 116 117 bool userHasPendingQuote = Dynamicweb.Ecommerce.Common.Context.Cart != null && Dynamicweb.Ecommerce.Common.Context.Cart.IsQuote; 118 119 if (product.VariantInfo.VariantInfo == null || whenVariantsExist == "disable") 120 { 121 unitId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.Form.Get("UnitId")) ? Dynamicweb.Context.Current.Request.Form.Get("UnitId") : product.DefaultUnitId; 122 if (string.IsNullOrEmpty(unitId) && product?.UnitOptions != null) 123 { 124 if (product.UnitOptions.FirstOrDefault<UnitOptionViewModel>() != null) 125 { 126 unitId = product.UnitOptions.FirstOrDefault<UnitOptionViewModel>().Id; 127 } 128 } 129 130 double? stepQty = product.PurchaseQuantityStep > 0 ? product.PurchaseQuantityStep : 1; 131 double? minQty = product.PurchaseMinimumQuantity > 0 ? product.PurchaseMinimumQuantity : 1; 132 double? valueQty = minQty > stepQty ? minQty : stepQty; 133 string disableAddToCart = null; 134 double? maxQty = null; 135 double totalstock = 0; 136 137 long CCStoreIdInt = 0; 138 139 IEnumerable<StockLocation> stocklocList = Dynamicweb.Ecommerce.Services.StockService.GetStockLocations(); 140 foreach (StockLocation stockloc in stocklocList) 141 { 142 string description = stockloc.GetDescription(Dynamicweb.Ecommerce.Common.Context.LanguageID); 143 DiscountService discountService = new DiscountService(); 144 double StockLevel = discountService.GetCCLiveStock(product.Number, description, unitId, Pageview.Area.EcomLanguageId); 145 if (StockLevel > 0) 146 { 147 totalstock = totalstock + StockLevel; 148 } 149 150 if (!String.IsNullOrEmpty(CCStoreId)) 151 { 152 if (description == CCStoreId) 153 { 154 CCStoreIdInt = stockloc.ID; 155 } 156 } 157 158 } 159 160 if (product.ProductType == Dynamicweb.Ecommerce.Products.ProductType.Stock && !product.NeverOutOfstock) 161 { 162 disableAddToCart = (totalstock <= 0) || (!product.NeverOutOfstock && isLazyLoadingForProductInfoEnabled) ? "disabled" : disableAddToCart; 163 maxQty = totalstock; 164 } 165 166 disableAddToCart = whenVariantsExist == "disable" && product.VariantInfo.VariantInfo != null && string.IsNullOrEmpty(product.VariantId) ? "disabled" : disableAddToCart; 167 disableAddToCart = (!isClickCollect && orderlinecount > 0) ? "disabled" : disableAddToCart; 168 169 if (unitsSelector && product.UnitOptions.Count > 0) 170 { 171 <form method="post" action="/Default.aspx?ID=@(Pageview.Page.ID)&ProductId=@product.Id" id="UnitSelectorForm_@(product.Id)_@(product.VariantId.Replace(".", "_"))_@Model.ID"> 172 <input type="hidden" name="redirect" value="false"> 173 <input type="hidden" name="VariantID" value="@product.VariantId"> 174 <input type="hidden" name="UnitID" class="js-unit-id" value="@unitId"> 175 </form> 176 } 177 178 <div class="d-flex @horizontalAlign @fullWidth js-input-group item_@Model.Item.SystemName.ToLower() @display"> 179 @if (!anonymousUser && favoritesSelector) 180 { 181 @RenderPartial("Components/ToggleFavorite.cshtml", product) 182 } 183 184 <form method="post" action="@url" class="@fullWidth" style="z-index: 1"> 185 <input type="hidden" name="redirect" value="false"> 186 <input type="hidden" name="ProductId" value="@product.Id"> 187 <input type="hidden" name="ProductName" value="@HtmlEncoder.HtmlEncode(product.Name)"> 188 <input type="hidden" name="ProductVariantName" value="@product.VariantName"> 189 <input type="hidden" name="ProductCurrency" value="@Dynamicweb.Ecommerce.Common.Context.Currency.Code"> 190 <input type="hidden" name="ProductPrice" value="@PriceViewModelExtensions.ToStringInvariant(product.Price)"> 191 <input type="hidden" name="ProductReferer" value="component_ProductAddToCart"> 192 <input type="hidden" name="cartcmd" value="add"> 193 <input type="hidden" name="StockLocationId" id="StockLocationId" value="@CCStoreIdInt" /> 194 <input type="hidden" id="CusClickCollectOrder" value="@isClickCollect" /> 195 @* <input type="submit" class="d-none" onclick="event.preventDefault(); swift.Cart.Update(event)"> @* Fix for enterKey should not redirect to minicart page *@ 196 197 @if (!string.IsNullOrEmpty(product.VariantId)) 198 { 199 <input type="hidden" name="VariantId" value="@product.VariantId"> 200 } 201 202 <template class="js-step-quantity-warning"> 203 <div class="modal-header"> 204 <h1 class="modal-title fs-5">@Translate("The quantity is not valid")</h1> 205 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 206 </div> 207 <div class="modal-body"> 208 @Translate("Please select a quantity that is dividable by") @stepQty 209 </div> 210 </template> 211 212 213 <template class="js-min-quantity-warning"> 214 <div class="modal-header"> 215 <h1 class="modal-title fs-5">@Translate("The product could not be added to the cart")</h1> 216 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 217 </div> 218 <div class="modal-body"> 219 @Translate("The quantity is not valid. You must buy at least") @product.PurchaseMinimumQuantity 220 </div> 221 </template> 222 223 <template class="js-value-missing-warning"> 224 <div class="modal-header"> 225 <h1 class="modal-title fs-5">@Translate("No amount specified")</h1> 226 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 227 </div> 228 <div class="modal-body"> 229 @Translate("Specify an amount to add to the cart") 230 </div> 231 </template> 232 233 234 @if (userHasPendingQuote) 235 { 236 <input type="hidden" name="PendingQuote" value="true"> 237 238 <template class="js-pending-quote-notice"> 239 <div class="modal-header"> 240 <h1 class="modal-title fs-5">@Translate("Pending Quote")</h1> 241 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="@Translate("Close")"></button> 242 </div> 243 <div class="modal-body"> 244 @Translate("You need to complete your current quote or empty the cart before adding this product to cart.") 245 </div> 246 </template> 247 } 248 249 <input type="hidden" id="Unit_@(product.Id)_@product.VariantId.Replace(".", "_")" name="UnitID" value="@unitId" /> 250 251 <div class="d-flex flex-row w-100"> 252 @if (!quantitySelector) 253 { 254 <input id="Quantity_@(product.Id)_@product.VariantId.Replace(".", "_")" class="swift_quantity_field" name="Quantity" value="@valueQty" type="hidden" @disableAddToCart> 255 } 256 257 @if (unitsSelector && product.UnitOptions.Count > 0) 258 { 259 string selectedUnitName = !string.IsNullOrEmpty(unitId) && product?.UnitOptions != null ? unitId : product.UnitOptions.FirstOrDefault<UnitOptionViewModel>().Name; 260 261 foreach (var unitOption in product.UnitOptions) 262 { 263 if (unitOption.Id == unitId) 264 { 265 selectedUnitName = unitOption.Name; 266 } 267 } 268 269 <div class="d-flex flex-column gap-2 w-100"> 270 <div class="input-group input-primary-button-group flex-nowrap@(inputSize)"> 271 272 @if (quantitySelector) 273 { 274 <input id="Quantity_@(product.Id)_@product.VariantId.Replace(".", "_")" name="Quantity" value="@DoubleToString(valueQty)" step="@DoubleToString(stepQty)" min="@DoubleToString(minQty)" max="@DoubleToString(maxQty)" class="form-control swift_quantity-field" style="min-width: 60px; max-width: 100px; z-index: 1" onkeydown="if(event.key==='.'){event.preventDefault();}" oninput="event.target.value = event.target.value.replace(/[^0-9]*/g,'');" type="number" @disableAddToCart> 275 } 276 277 <button class="btn btn-secondary @flexFill dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> 278 @selectedUnitName 279 </button> 280 281 <ul class="dropdown-menu swift_unit-field"> 282 @foreach (var unitOption in product.UnitOptions) 283 { 284 var selectedUnit = unitOption.Id == unitId ? "selected" : ""; 285 286 <li> 287 <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'); 288 document.querySelector('#Unit_@(product.Id)_@product.VariantId.Replace(".", "_")').value = this.getAttribute('data-value'); 289 swift.PageUpdater.Update(document.querySelector('#UnitSelectorForm_@(product.Id)_@(product.VariantId.Replace(".", "_"))_@Model.ID'))"> 290 <span>@unitOption.Name</span> 291 <span> 292 @if (unitOption.StockLevel > 0 || unitOption.NeverOutOfStock) 293 { 294 if (!Model.Item.GetBoolean("HideInventory") && !unitOption.NeverOutOfStock) 295 { 296 <span class="small text-success">@unitOption.StockLevel @Translate("In stock")</span> 297 } 298 else 299 { 300 <span class="small text-success">@Translate("In stock")</span> 301 } 302 } 303 else 304 { 305 <span class="small text-danger">@Translate("Out of Stock")</span> 306 } 307 </span> 308 </button> 309 </li> 310 } 311 </ul> 312 </div> 313 <button type="button" onclick="clicktoCollect(event,'@product.Id','@unitId');" class="btn btn-primary CCAddToCartBtn @(buttonSize) js-add-to-cart-button" style="white-space: nowrap" @disableAddToCart title="@Translate("Add to cart")" id="AddToCartButton@(product.Id)_@Pageview.CurrentParagraph.ID"> 314 @if (!Model.Item.GetBoolean("HideButtonText")) 315 { 316 <span class="text-nowrap d-flex align-items-center justify-content-center gap-2"> 317 @addToCartLabel 318 </span> 319 } 320 else 321 { 322 @addToCartLabel 323 } 324 </button> 325 </div> 326 } 327 else 328 { 329 <div class="input-group input-primary-button-group flex-nowrap@(inputSize)"> 330 @if (quantitySelector) 331 { 332 <input id="Quantity_@(product.Id)_@product.VariantId.Replace(".", "_")" name="Quantity" value="@DoubleToString(valueQty)" step="@DoubleToString(stepQty)" min="@DoubleToString(minQty)" max="@DoubleToString(maxQty)" class="form-control swift_quantity-field" style="min-width: 60px; max-width: 100px; z-index: 1" onkeydown="if(event.key==='.'){event.preventDefault();}" oninput="event.target.value = event.target.value.replace(/[^0-9]*/g,'');" type="number" @disableAddToCart> 333 } 334 335 <button type="button" onclick="clicktoCollect(event,'@product.Id','@unitId');" class="btn btn-primary CCAddToCartBtn @(buttonSize) @flexFill js-add-to-cart-button" style="white-space: nowrap" @disableAddToCart title="@Translate("Add to cart")" id="AddToCartButton@(product.Id)_@Pageview.CurrentParagraph.ID"> 336 @if (!Model.Item.GetBoolean("HideButtonText")) 337 { 338 <span class="text-nowrap d-flex align-items-center justify-content-center gap-2"> 339 @addToCartLabel 340 </span> 341 } 342 else 343 { 344 @addToCartLabel 345 } 346 </button> 347 </div> 348 } 349 </div> 350 351 <button type="button" id="cus_ClickCollect" class="d-none" onclick="swift.Cart.Update(event)">@Translate("Click and Collect")</button> 352 <div id="Cus_ClickCollectContent"> 353 <div class="cus-collectModel__bg"> 354 <div class="cus-collectModel__con"> 355 <div class="cus_colloct__header cus_p10"> 356 <div>@Translate("In-store stock availability")</div> 357 <button type="button" class="btn cus_svg p-0" onclick="HideClkCollect()">@ReadFile("/Files/Icons/x.svg")</button> 358 </div> 359 <div class="cus_colloct__body cus_p10"> 360 <div class="cus_fw700 cus_darkblue">@product.Name</div> 361 <div class="cus_clt__container"> 362 @{ 363 IEnumerable<StockLocation> ccstocklocList = Dynamicweb.Ecommerce.Services.StockService.GetStockLocations(); 364 foreach (StockLocation stockloc in ccstocklocList) 365 { 366 string description = stockloc.GetDescription(Dynamicweb.Ecommerce.Common.Context.LanguageID); 367 DiscountService discountService = new DiscountService(); 368 double StockLevel = discountService.GetCCLiveStock(product.Number, description, unitId, Pageview.Area.EcomLanguageId); 369 if (StockLevel > 0) 370 { 371 <div class="cus_btn_con"> 372 <div class="cus_w75"> 373 <div> 374 <span class="cus_chechIcon">@ReadFile("/Files/Icons/check.svg")</span> 375 <span class="cus_lightgreen"> @stockloc.GetName(Dynamicweb.Ecommerce.Common.Context.LanguageID)</span> 376 </div> 377 <div class="cus_darkblue">@Translate("In stock") (@StockLevel @Translate("qty"))</div> 378 </div> 379 <div class="cus_w25 cus_darkblue"><button class="btn cus_btn" onclick="AddClickCollectProduct('@stockloc.ID','@description',event); CollectItem();">@Translate("Collect")</button></div> 380 </div> 381 } 382 383 } 384 } 385 386 </div> 387 <div> 388 <div class="cus_fw700 cus_darkblue">@Translate("Choose you store to:")</div> 389 <div class="cus_darkblue"> 390 <div> 391 @Translate("Access its contact details, opening hours, services, etc.") 392 </div> 393 <div> 394 @Translate("View all available products and commercial offers") 395 </div> 396 </div> 397 </div> 398 </div> 399 <div class="cus_colloct__footer cus_p10"> 400 <div>@Translate("Our entire online offer can be found directly in store.")</div> 401 </div> 402 </div> 403 </div> 404 </form> 405 </div> 406 407 } 408 else if (whenVariantsExist == "modal") 409 { 410 string ButtonShape = Model.Item.GetRawValueString("VariantButtonShape", "square"); 411 string buttonAspectRatio = Model.Item.GetRawValueString("VariantImageAspectRatio", "56%"); 412 413 string buttonText = Translate("Select"); 414 string variantId = !string.IsNullOrWhiteSpace(product.VariantId) ? product.VariantId : product.DefaultVariantId; 415 416 string variantSelectorServicePageId = !string.IsNullOrEmpty(Model.Item.GetString("VariantSelectorServicePageId")) ? Model.Item.GetLink("VariantSelectorServicePageId").PageId.ToString() : ""; 417 variantSelectorServicePageId = variantSelectorServicePageId != "" ? variantSelectorServicePageId : GetPageIdByNavigationTag("VariantSelectorService").ToString(); 418 419 <div class="d-flex @horizontalAlign w-100 item_@Model.Item.SystemName.ToLower()"> 420 @if (!anonymousUser && favoritesSelector) 421 { 422 @RenderPartial("Components/ToggleFavorite.cshtml", product) 423 } 424 <form action="/Default.aspx?ID=@variantSelectorServicePageId" data-response-target-element="DynamicModalContent" data-preloader="inline" style="z-index: 1" class="@fullWidth"> 425 <input type="hidden" name="ProductID" value="@product.Id"> 426 <input type="hidden" name="VariantID" value="@variantId"> 427 <input type="hidden" name="QuantitySelector" value="@quantitySelector.ToString()"> 428 <input type="hidden" name="HideInventory" value="@hideInventory.ToString()"> 429 <input type="hidden" name="HideStockState" value="@hideStockState.ToString()"> 430 <input type="hidden" name="ButtonLayout" value="@ButtonShape"> 431 <input type="hidden" name="ButtonAspectRatio" value="@buttonAspectRatio"> 432 <input type="hidden" name="VariantSelectorServicePage" value="@variantSelectorServicePageId"> 433 <input type="hidden" name="ViewType" value="ModalContent"> 434 @if (isLazyLoadingForProductInfoEnabled) 435 { 436 @* If lazy loading is enabled, bypass it because we're loading a modal window, so render everything as if it was server-side *@ 437 <input type="hidden" name="getproductinfo" value="true"> 438 } 439 <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> 440 </form> 441 </div> 442 } 443 } 444 else if (Pageview.IsVisualEditorMode) 445 { 446 <div class="alert alert-dark m-0">@Translate("No products available")</div> 447 } 448 449 <script> 450 function HideClkCollect() { 451 $(".cus-collectModel__bg").removeClass("show"); 452 } 453 function CollectItem() { 454 HideClickandCollect(); 455 } 456 function AddClickCollectProduct(stocklocId, storeId, event) { 457 $("#StockLocationId").val(stocklocId); 458 const clickCollectBtn = document.getElementById("cus_ClickCollect"); 459 clickCollectBtn.click(); 460 const addcartTimeout = setTimeout(function () { 461 UpdateClickCollectStoreForProduct(storeId, stocklocId, "@product.Id","@unitId"); 462 }, 200); 463 } 464 </script>
Error executing template "/Designs/Swift/Paragraph/Cus_ProductInfo_Collapsible_ProductHeader.cshtml"
System.Data.SqlClient.SqlException (0x80131904): SHUTDOWN is in progress.
Login failed for user 'datupgadmin'.
Cannot continue the execution because the session is in the kill state.
A severe error occurred on the current command.  The results, if any, should be discarded.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
   at Dynamicweb.Data.Database.CreateDataReader(IDbCommand command, CommandBehavior behavior)
   at Dynamicweb.Data.Database.CreateDataReader(String sql, IDbConnection connection, IDbTransaction transaction, CommandBehavior behavior, Int32 commandTimeout, Dictionary`2 sqlParams)
   at Dynamicweb.Data.Database.CreateDataReader(String sql, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout, Dictionary`2 sqlParams)
   at Dynamicweb.Data.Database.CreateDataReader(String sql)
   at CustomServices.Services.CommentsService.GetGivenRatingCount(String productId)
   at CompiledRazorTemplates.Dynamic.RazorEngine_ee60f098ce8541a49c2ab0e05ca8ec85.ExecuteAsync()
   at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
ClientConnectionId:90c41c44-5cd4-4eb8-b80c-371eef02b713
Error Number:6005,State:1,Class:14

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Ecommerce.ProductCatalog 3 @using System.Text.RegularExpressions; 4 @using CustomServices.Services 5 @using CustomServices.Models 6 7 @{ 8 ProductViewModel product = null; 9 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 10 { 11 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 12 } 13 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 14 { 15 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 16 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 17 18 if (productList?.Products is object) 19 { 20 product = productList.Products[0]; 21 } 22 } 23 } 24 25 @if (product is object) 26 { 27 string titleFontSize = Model.Item.GetRawValueString("FontSize", "fs-6"); 28 string horizontalAlign = Model.Item.GetRawValueString("HorizontalAlignment", ""); 29 horizontalAlign = horizontalAlign == "center" ? "text-center" : horizontalAlign; 30 horizontalAlign = horizontalAlign == "end" ? "text-end" : horizontalAlign; 31 32 var ProductShortDescriptionValue = product.ShortDescription; 33 string prodShortDesc = Regex.Replace(ProductShortDescriptionValue, "<.*?>", string.Empty); 34 var ProductLongDescriptionValue = product.LongDescription; 35 string prodLongDesc = Regex.Replace(ProductLongDescriptionValue, "<.*?>", string.Empty); 36 var Shipping_DeliveryValue = product.ProductFields.FirstOrDefault(x => x.Key == "Shipping_Delivery").Value; 37 var ProductApplications = product.ProductFields.FirstOrDefault(x => x.Key == "Ap").Value; 38 39 int ratingCount = 0; 40 CommentsService commentsService = new CommentsService(); 41 ratingCount = commentsService.GetGivenRatingCount(product.Id); 42 double rating = 0; 43 if (product != null) 44 { 45 rating = product.Rating ?? 0; 46 } 47 int rate2loop = (int)product.Rating; 48 bool haverating = false; 49 List<CommentsView> comments = new List<CommentsView>(); 50 comments = commentsService.GetOnlyAllCommentsForProduct(product.Id, "recent"); 51 52 @if (!string.IsNullOrEmpty(prodShortDesc.ToString())) 53 { 54 <div class="cus_cus-prodetail__shipcontent"> 55 <div class="cus_cus-prodetail__shipleft" onclick="cus_toggleDetails('cus_ProDetailDescriptionData', 'cus_chevron-down1', 'cus_chevron-up1');"> 56 <div class="cus_cus-prodetail__shiptitle"> 57 <h2 class="cus_cus-prodetail__shiptitletext"><b>@Translate("Description")</b></h2> 58 <div class="cus_cus-prodetail__shipright"> 59 <svg class="feather feather-chevron-down" id="cus_chevron-down1" style="display: block;"> 60 <polyline points="6 9 12 15 18 9"></polyline> 61 </svg> 62 <svg class="feather feather-chevron-up" id="cus_chevron-up1" style="display: none;"> 63 <polyline points="18 15 12 9 6 15"></polyline> 64 </svg> 65 </div> 66 </div> 67 </div> 68 <div class="cus_cus-prodetail__shipdetails" id="cus_ProDetailDescriptionData"> 69 <p>@ProductShortDescriptionValue</p> 70 </div> 71 </div> 72 } 73 74 @if (!string.IsNullOrEmpty(prodLongDesc.ToString())) 75 { 76 <div class="cus_cus-prodetail__shipcontent"> 77 <div class="cus_cus-prodetail__shipleft" onclick="cus_toggleDetails('cus_ProDetailInfoData', 'cus_chevron-down2', 'cus_chevron-up2');"> 78 <div class="cus_cus-prodetail__shiptitle"> 79 <h2 class="cus_cus-prodetail__shiptitletext"><b>@Translate("More Information")</b></h2> 80 <div class="cus_cus-prodetail__shipright"> 81 <svg class="feather feather-chevron-down" id="cus_chevron-down2" style="display: block;"> 82 <polyline points="6 9 12 15 18 9"></polyline> 83 </svg> 84 <svg class="feather feather-chevron-up" id="cus_chevron-up2" style="display: none;"> 85 <polyline points="18 15 12 9 6 15"></polyline> 86 </svg> 87 </div> 88 </div> 89 </div> 90 <div class="cus_cus-prodetail__shipdetails" id="cus_ProDetailInfoData"> 91 <p>@ProductLongDescriptionValue</p> 92 </div> 93 </div> 94 } 95 96 @if (!string.IsNullOrEmpty(ProductApplications.ToString())) 97 { 98 <div class="cus_cus-prodetail__shipcontent"> 99 <div class="cus_cus-prodetail__shipleft" onclick="cus_toggleDetails('cus_ProDetailApplicationData', 'cus_chevron-down5', 'cus_chevron-up5');"> 100 <div class="cus_cus-prodetail__shiptitle"> 101 <h2 class="cus_cus-prodetail__shiptitletext"><b>@Translate("Application")</b></h2> 102 <div class="cus_cus-prodetail__shipright"> 103 <svg class="feather feather-chevron-down" id="cus_chevron-down5" style="display: block;"> 104 <polyline points="6 9 12 15 18 9"></polyline> 105 </svg> 106 <svg class="feather feather-chevron-up" id="cus_chevron-up5" style="display: none;"> 107 <polyline points="18 15 12 9 6 15"></polyline> 108 </svg> 109 </div> 110 </div> 111 </div> 112 <div class="cus_cus-prodetail__shipdetails" id="cus_ProDetailApplicationData"> 113 <p>@ProductApplications</p> 114 </div> 115 </div> 116 } 117 118 @if (!string.IsNullOrEmpty(Shipping_DeliveryValue.ToString())) 119 { 120 <div class="cus_cus-prodetail__shipcontent"> 121 <div class="cus_cus-prodetail__shipleft" onclick="cus_toggleDetails('cus_ProDetailShippingData', 'cus_chevron-down3', 'cus_chevron-up3');"> 122 <div class="cus_cus-prodetail__shiptitle"> 123 <h2 class="cus_cus-prodetail__shiptitletext"><b>@Translate("Shipping & Delivery")</b></h2> 124 <div class="cus_cus-prodetail__shipright"> 125 <svg class="feather feather-chevron-down" id="cus_chevron-down3" style="display: block;"> 126 <polyline points="6 9 12 15 18 9"></polyline> 127 </svg> 128 <svg class="feather feather-chevron-up" id="cus_chevron-up3" style="display: none;"> 129 <polyline points="18 15 12 9 6 15"></polyline> 130 </svg> 131 </div> 132 </div> 133 </div> 134 <div class="cus_cus-prodetail__shipdetails" id="cus_ProDetailShippingData"> 135 <p>@Shipping_DeliveryValue</p> 136 </div> 137 </div> 138 } 139 140 @if (product.Rating > 0) 141 { 142 int count = 0; 143 <div class="cus_cus-prodetail__shipcontent"> 144 <div class="cus_cus-prodetail__shipleft" onclick="cus_toggleDetails('cus_ProDetailReviewsData', 'cus_chevron-down4', 'cus_chevron-up4');"> 145 <div class="cus_cus-prodetail__shiptitle"> 146 <h2 class="cus_cus-prodetail__shiptitletext"><b>@Translate("Reviews")</b></h2> 147 <div class="cus_cus-prodetail__shipright"> 148 <svg class="feather feather-chevron-down" id="cus_chevron-down4" style="display: block;"> 149 <polyline points="6 9 12 15 18 9"></polyline> 150 </svg> 151 <svg class="feather feather-chevron-up" id="cus_chevron-up4" style="display: none;"> 152 <polyline points="18 15 12 9 6 15"></polyline> 153 </svg> 154 </div> 155 </div> 156 </div> 157 <div class="cus_cus-prodetail__shipdetails" id="cus_ProDetailReviewsData"> 158 <div class="mb-0-last-child custom_accordionbody gap-0 pt-0"> 159 @foreach (CommentsView comment in comments.Take(3)) 160 { 161 count++; 162 bool isFirst = count == 1; // Check if it's the first comment 163 <div class="custom_detail_review cus__dr accordion-item cus_accordion_item"> 164 <h2 class="accordion-header" id="heading-ReviewHeader_@count"> 165 <button class="accordion-button cus_accordion_btn cus_rv_acc cus_fs16 @(isFirst ? "" : "collapsed")" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-ReviewHeader_@count" aria-expanded="@(isFirst ? "true" : "false")" aria-controls="collapse-ReviewHeader_@count"> 166 <div> 167 <div class="custom_f12 ">@comment.CommentDate</div> 168 <div class="fw-bold custom_f16 pt-2">@comment.CommentBy</div> 169 </div> 170 </button> 171 </h2> 172 <div id="collapse-ReviewHeader_@count" class="accordion-collapse collapse @(isFirst ? "show" : "")" aria-labelledby="heading-ReviewHeader_@count" data-bs-parent="#accordion-ReviewHeader_@count"> 173 <div class="accordion-body mb-0-last-child cus_fs16 pt-0"> 174 <div class="cus_fs16"> 175 @comment.Comment 176 </div> 177 <div> 178 @foreach (CommentsStars comstar in comment.commentsStars) 179 { 180 <span>@comstar.star</span> 181 } 182 </div> 183 </div> 184 </div> 185 </div> 186 } 187 @if (ratingCount > 3) 188 { 189 string grplink = product.GetProductLink(GetPageIdByNavigationTag("ProductReviewDetailPage"), false); 190 <div class="text-center"> 191 <a href="@grplink" class="btn btn-link customfw400 custom_f12" style="color: #7E7E7E;">@Translate("View all") @ratingCount @Translate("reviews")</a> 192 </div> 193 } 194 195 </div> 196 </div> 197 </div> 198 } 199 200 } 201 else if (Pageview.IsVisualEditorMode) 202 { 203 <div class="alert alert-dark m-0">@Translate("No products available")</div> 204 } 205
Error executing template "Designs/Swift/Paragraph/Custom_MixMatchSlider.cshtml"
System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The handle specified is invalid)
 ---> System.ComponentModel.Win32Exception (0x80090301): The handle specified is invalid
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.Open()
   at Dynamicweb.Data.DatabaseConnectionProvider.CreateConnection(Boolean open)
   at Dynamicweb.Data.Database.CreateConnection()
   at Dynamicweb.Data.Database.CreateDataReader(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout)
   at Dynamicweb.Ecommerce.Products.GroupRepository.GetGroupShopIds(String groupId)
   at Dynamicweb.Ecommerce.Products.GroupService.GetGroupShops(String groupId)
   at Dynamicweb.Ecommerce.Orders.Discounts.DiscountService.GetDiscounts(Product product, Boolean excludingDiscount)
   at CustomServices.Services.DiscountService.ReturnDiscountsMixAndMatch(String productId, String varientId)
   at CompiledRazorTemplates.Dynamic.RazorEngine_a2aeb5466eb84119b1b4ab1a88eef932.ExecuteAsync()
   at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()
ClientConnectionId:2f9f0ab1-e4ad-4043-aacd-9fa24b7cca04
Error Number:‎-2146893055,State:0,Class:20

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Ecommerce.ProductCatalog 3 @using Dynamicweb.Ecommerce.International 4 @using CustomServices.Services 5 @using CustomServices.Models 6 @using Newtonsoft.Json 7 @{ 8 ProductViewModel product = null; 9 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 10 { 11 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 12 } 13 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 14 { 15 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 16 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 17 18 if (productList?.Products is object) 19 { 20 product = productList.Products[0]; 21 } 22 } 23 ProductViewModelSettings productSetting = new ProductViewModelSettings 24 { 25 LanguageId = Dynamicweb.Ecommerce.Common.Context.LanguageID, 26 CurrencyCode = Dynamicweb.Ecommerce.Common.Context.Currency.Code, 27 CountryCode = Dynamicweb.Ecommerce.Common.Context.Country.Code2, 28 ShopId = Pageview.Area.EcomShopId 29 }; 30 int itemCount = Model.Item.GetInt32("Product_Count"); 31 } 32 33 @if (product is object) 34 { 35 DiscountService discountService = new DiscountService(); 36 List<MixAndMatchProductInfo> mixAndMatchProductInfos = new List<MixAndMatchProductInfo>(); 37 mixAndMatchProductInfos = discountService.ReturnDiscountsMixAndMatch(product.Id, product.VariantId); 38 string title = ""; 39 if (mixAndMatchProductInfos.Count > 0) 40 { 41 title = mixAndMatchProductInfos[0].discountName; 42 } 43 44 string detailPageId = GetPageIdByNavigationTag("ProductDetailPage") != 0 ? GetPageIdByNavigationTag("ProductDetailPage").ToString() : ""; 45 string productDetailUrl = "/Default.aspx?ID=" + detailPageId; 46 @if (mixAndMatchProductInfos.Count > 0) 47 { 48 <div class="detail-discount__products" style="direction:ltr;"> 49 <div class="detail-discounts"> 50 <h3 class="detail-discounttitle">@title</h3> 51 <div id="slider_@(Model.ID)" class="swiffy-slider slider-item-show@(itemCount) slider-nav-chevron-default slider-nav-on-slides slider-nav-visible slider-indicators-dash"> 52 <ul class="slider-container"> 53 @foreach (var mixAndMatchProductInfo in mixAndMatchProductInfos) 54 { 55 ProductViewModel productModel = new ProductViewModel(); 56 productModel = ViewModelFactory.CreateView(productSetting, mixAndMatchProductInfo.productId); 57 string productDetailPage = productDetailUrl + "&productId=" + mixAndMatchProductInfo.productId; 58 if (mixAndMatchProductInfo.variantId != "") 59 { 60 productDetailPage += "&variantid=" + mixAndMatchProductInfo.variantId; 61 } 62 <li class="detail-discountproduct__content" style="cursor:pointer;"> 63 <a href="@productDetailPage" class="text-decoration-none d-block h-100 text-xl-center"> 64 <div class="h-100 d-flex flex-column justify-content-between"> 65 <div class="" style="border: 1px solid transparent;"> 66 <div class="ratio position-relative" style="--bs-aspect-ratio: 75%"> 67 <img src="/Admin/Public/GetImage.ashx?image=@(productModel.DefaultImage.Value)&amp;width=350&amp;Format=WebP&amp;Quality=70" class="h-100 w-100 " style="object-fit: contain;"> 68 </div> 69 </div> 70 <div class="flex-fill d-flex flex-column justify-content-between cust-slider-mbinfo"> 71 <div style="height:2.5em; text-align:center;"> 72 <h3 class="h6 opacity-85" style="word-break:break-all;">@mixAndMatchProductInfo.productName</h3> 73 </div> 74 <div style="text-align:center;"> 75 <p class="h6 m-0"> 76 <span class="text-price fw-bold slideractiveprice">@mixAndMatchProductInfo.productPrice</span> 77 </p> 78 </div> 79 </div> 80 </div> 81 </a> 82 </li> 83 } 84 </ul> 85 <button type="button" title="@Translate("Previous slide")" class="slider-nav cusdiscount-slider__nav" style="z-index:2;"></button> 86 <button type="button" title="@Translate("Next slide")" class="slider-nav slider-nav-next cusdiscount-slider__nav" style="z-index:2;"></button> 87 </div> 88 </div> 89 </div> 90 <link rel="stylesheet" href="/Files/Templates/Designs/Swift/Assets/css/swiffy-slider.min.css"> 91 <script src="/Files/Templates/Designs/Swift/Assets/js/swiffy-slider.js"></script> 92 <script> 93 swiffyslider.initSlider(document.querySelector('#slider_@(Model.ID)')); 94 </script> 95 } 96 } 97 else if (Pageview.IsVisualEditorMode) 98 { 99 <div class="alert alert-warning">@Translate("No products available")</div> 100 } 101

You Might Like also

;
بالنقر على "قبول الكل"، فإنك توافق على أنه يجوز لنا جمع معلومات عنك لأغراض مختلفة، بما في ذلك: الإحصائيات والتسويق