Sélectionnez votre variante
Sylgard 527 10KG
1060070_S10K
Sylgard 527 2KG
1060070_S2K
Sylgard 527
1060070_S35K
Une proposition d'offre?
Souhaitez-vous un devis ?
Souhaitez-vous plus d’informations ou un devis pour ce produit ? Cliquez sur le bouton ci-dessous pour demander une soumission gratuite.
Répond au besoin de Protection et d'étanchéité des composants sensibles
Lire la suiteLe Sylgard 527 est un Silicone bi-composants dédié aux applications Electriques et Electroniques/ polymérisation à température ambiante et à chaud (HTV & RTV). Répond au besoin de Protection et d'étanchéité des composants sensibles
Error executing template "Designs/Mavom_generated/Paragraph/ProductDetailWidgetRecentlyViewedProducts.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_9ac487dbd17b45f79e19a2c0fcc78ba0.<>c__DisplayClass0_0.<renderProductBlock>b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Bluedesk\viba.cloud.dynamicweb-cms.com\files\Templates\Designs\Mavom_generated\Paragraph\ProductDetailWidgetRecentlyViewedProducts.cshtml:line 120 at CompiledRazorTemplates.Dynamic.RazorEngine_9ac487dbd17b45f79e19a2c0fcc78ba0.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\viba.cloud.dynamicweb-cms.com\files\Templates\Designs\Mavom_generated\Paragraph\ProductDetailWidgetRecentlyViewedProducts.cshtml:line 71 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) 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 System.Globalization; 3 @using Dynamicweb.Caching; 4 @using Dynamicweb.Ecommerce.Prices; 5 @using Dynamicweb.Ecommerce.ProductCatalog; 6 @using Dynamicweb.Ecommerce.Products; 7 @using Dynamicweb.Ecommerce.Specialized.RelatedProductListProviders; 8 @using Dynamicweb.Ecommerce.Extensibility.Provider; 9 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 10 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 11 12 @{ 13 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 14 ProductDetailWidgetRecentlyViewedProducts _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetRecentlyViewedProducts", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetRecentlyViewedProducts>() ?? new ProductDetailWidgetRecentlyViewedProducts(); 15 16 ProductViewModel product = new ProductViewModel(); 17 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 18 { 19 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 20 } 21 22 ProductViewModelSettings productSetting = new ProductViewModelSettings 23 { 24 LanguageId = Dynamicweb.Ecommerce.Common.Context.LanguageID, 25 CurrencyCode = Dynamicweb.Ecommerce.Common.Context.Currency.Code, 26 CountryCode = Dynamicweb.Ecommerce.Common.Context.Country.Code2, 27 ShopId = Pageview.Area.EcomShopId 28 }; 29 30 var seenProductsFromSession = Dynamicweb.Context.Current.Session["YouHaveSeenTheseProductsList"]; 31 List<string> recentlyViewedProductIds = null; 32 List<ProductViewModel> recentProducts = new List<ProductViewModel>(); 33 34 if(seenProductsFromSession != null && !string.IsNullOrWhiteSpace(seenProductsFromSession.ToString())) 35 { 36 string productId = string.IsNullOrWhiteSpace(product.VariantId) ? product.Id : $"{product.Id};{product.VariantId}"; 37 recentlyViewedProductIds = ((string[])seenProductsFromSession).Where(id => id != productId).Take(4).ToList(); 38 foreach (string id in recentlyViewedProductIds) 39 { 40 string prodId = id; 41 string variantId = ""; 42 if(id.Contains(";")) 43 { 44 prodId = id.Split(';')[0]; 45 variantId = id.Split(';')[1]; 46 } 47 48 ProductViewModel prod = ViewModelFactory.CreateView(productSetting, prodId, variantId); 49 if(prod != null) 50 { 51 recentProducts.Add(prod); 52 } 53 } 54 } 55 var index = 1; 56 string ClassIgniteCarousel = recentProducts.Count() > 4 ? "products-module__container--carousel" : ""; 57 var groupTitle = Translate("Productdetail.RecentlyViewedArticles", "Recently viewed articles"); 58 } 59 60 @if(recentProducts.Any()) 61 { 62 <section id="@paragraphID" class="pdp-paragraph pdp-related-products-widget @_data.CssClass"> 63 <section class="products-module__container @ClassIgniteCarousel"> 64 <div class="container"> 65 <header class="products-module__header"> 66 <h2 class="products-module__title">@groupTitle</h2> 67 </header> 68 <ul class="products-module__slider"> 69 @foreach (ProductViewModel prod in recentProducts) 70 { 71 @renderProductBlock(prod, "recently_viewed_articles", groupTitle, index); 72 index++; 73 } 74 </ul> 75 </div> 76 </section> 77 </section> 78 } 79 80 @helper renderProductBlock(Dynamicweb.Ecommerce.ProductCatalog.ProductViewModel product, string listId, string listName, int index) 81 { 82 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 83 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 84 EcomConfig EcommerceConfiguration = mc.EcomConfiguration; 85 86 string productName = product.Name; 87 88 var relProdService = new Dynamicweb.Ecommerce.Products.ProductService(); 89 var relProd = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, product.VariantId, Pageview.Area.EcomLanguageId); 90 string productImage = Dynamicweb.Ecommerce.Services.ProductImages.GetImagePath(relProd); 91 92 if (string.IsNullOrWhiteSpace(productImage)) 93 { 94 try 95 { 96 var perfionImage = relProdService.GetProductFieldValue(relProd, "AdditionalImages"); 97 productImage = $"Files/" + perfionImage.ToString().Split(';')[0]; 98 } 99 catch (Exception) { } 100 } 101 102 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True"; 103 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers; 104 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber; 105 if(pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null) { 106 WithVATBool = false; 107 } 108 if(pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) { 109 WithVATBool = false; 110 } 111 112 int productDetailPageId = GetPageIdByNavigationTag("ProductOverview"); 113 string currentPageUrl = "/Default.aspx?ID=" + Pageview.Page.ID; 114 string specifier = "G"; 115 CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US"); 116 117 string productNumber = product.Number; 118 string productId = product.Id; 119 string productVariantId = !string.IsNullOrWhiteSpace(product.VariantId) ? product.VariantId : ""; 120 string productURL = $"Default.aspx?ID={productDetailPageId}&GroupID={product.PrimaryOrDefaultGroup.Id}&ProductID={product.Id}"; 121 productURL += !string.IsNullOrWhiteSpace(product.VariantId) ? "&VariantID=" + product.VariantId : ""; 122 string productManufacturer = product.Manufacturer?.Name ?? ""; 123 124 bool isPriceZero = product.Price.Price <= 0; 125 bool hasDiscount = product.Discount.Price > 0; 126 string OriginalPrice = WithVATBool ? product.PriceBeforeDiscount.PriceWithVatFormatted : product.PriceBeforeDiscount.PriceWithoutVatFormatted; 127 string Price = WithVATBool ? product.Price.PriceWithVatFormatted : product.Price.PriceWithoutVatFormatted; 128 string yourDiscount = WithVATBool ? product.Discount.PriceWithVatFormatted : product.Discount.PriceWithoutVatFormatted; 129 string gtmDiscount = WithVATBool ? Math.Round(product.Discount.PriceWithVat, 2, MidpointRounding.AwayFromZero).ToString(specifier, culture) : Math.Round(product.Discount.PriceWithoutVat, 2, MidpointRounding.AwayFromZero).ToString(specifier, culture); 130 string gtmPrice = WithVATBool ? Math.Round(product.PriceBeforeDiscount.PriceWithVat, 2, MidpointRounding.AwayFromZero).ToString(specifier, culture) : Math.Round(product.PriceBeforeDiscount.PriceWithoutVat, 2, MidpointRounding.AwayFromZero).ToString(specifier, culture); 131 string gtmValue = WithVATBool ? Math.Round(product.Price.PriceWithVat, 2, MidpointRounding.AwayFromZero).ToString(specifier, culture) : Math.Round(product.Price.PriceWithoutVat, 2, MidpointRounding.AwayFromZero).ToString(specifier, culture); 132 string ProductdetailPriceSuffixWithVAT = Translate("Productdetail.Price.Suffix.WithVAT", "Incl. VAT"); 133 string ProductdetailPriceSuffixWithoutVAT = Translate("Productdetail.Price.Suffix.WithoutVAT", "Excl. VAT"); 134 string ProductdetailPriceSuffix = WithVATBool ? ProductdetailPriceSuffixWithVAT : ProductdetailPriceSuffixWithoutVAT; 135 string gtmBrand = !string.IsNullOrWhiteSpace(product.Manufacturer.Name) ? product.Manufacturer.Name.Replace("''", "\\\"").Replace("'", "") : ""; 136 string gtmCategoryName = product.PrimaryOrDefaultGroup?.Name?.Replace("''", "\\\"").Replace("'", ""); 137 138 bool hideStockForGuests = EcommerceConfiguration.HideStockForGuests; 139 string stockFormat = EcommerceConfiguration.StockFormat; 140 bool enableProductStock = hideStockForGuests ? Pageview.User != null : true; 141 string stockText = product.StockStatus; 142 double stockSize = (double)product.StockLevel; 143 bool neverOutOfStock = product.NeverOutOfstock; 144 bool isInStock = stockSize > 0 || neverOutOfStock; 145 string stockClass = isInStock ? "products-module__product-stock-state--instock" : "products-module__product-stock-state--outofstock"; 146 string stockSizeFormatted = stockSize.ToString(stockSize % 1 == 0 ? "N0" : "N2", System.Globalization.CultureInfo.GetCultureInfo(Pageview.Area.CultureInfo.TwoLetterISOLanguageName)); 147 148 bool hideZeroPrices = EcommerceConfiguration.HideZeroPrices; 149 bool hidePricesForGuests = EcommerceConfiguration.HidePricesForGuests; 150 bool hideShoppingCartForGuests = EcommerceConfiguration.HideShoppingCartForGuests; 151 bool enableAddToCartForZeroPrices = EcommerceConfiguration.AddToCartAllowZeroPrices; 152 bool enableAddToCartForOutOfStock = EcommerceConfiguration.AddToCartAllowOutOfStock; 153 154 bool enableProductCompare = Pageview.Area.Item["ConfigModuleProductCompare"] != null ? (bool) Pageview.Area.Item["ConfigModuleProductCompare"] : false; 155 bool enableProductFavorites = Pageview.User == null ? false : Pageview.Area.Item["ConfigModuleFavoriteLists"] != null ? (bool)Pageview.Area.Item["ConfigModuleFavoriteLists"] : false; 156 157 bool enableShoppingCart = hideShoppingCartForGuests && Pageview.User == null ? false : Pageview.Area.Item["ConfigModuleShoppingCart"] != null ? (bool)Pageview.Area.Item["ConfigModuleShoppingCart"] : false; 158 bool enableProductShoppingCart = enableShoppingCart; 159 if(!enableAddToCartForZeroPrices && isPriceZero) { 160 enableProductShoppingCart = false; 161 } 162 163 if(!enableAddToCartForOutOfStock && !isInStock) { 164 enableProductShoppingCart = false; 165 } 166 167 if(product.Discontinued) { 168 enableProductShoppingCart = false; 169 } 170 171 bool displayPrice = hidePricesForGuests ? Pageview.User != null : true; 172 bool displayProductPrice = displayPrice; 173 if(hideZeroPrices && isPriceZero) { 174 displayProductPrice = false; 175 } 176 177 string informativePrice = WithVATBool ? product.PriceInformative.PriceWithVatFormatted : product.PriceInformative.PriceWithoutVatFormatted; 178 if (EcommerceConfiguration.UseInformativePriceAsFromPrice && !string.IsNullOrWhiteSpace(informativePrice)) 179 { 180 double informativePriceValue = WithVATBool ? product.PriceInformative.PriceWithVat : product.PriceInformative.PriceWithoutVat; 181 double priceValue = WithVATBool ? product.Price.PriceWithVat : product.Price.PriceWithoutVat; 182 hasDiscount = priceValue < informativePriceValue; 183 if (hasDiscount) 184 { 185 OriginalPrice = informativePrice; 186 double yourProfitValue = informativePriceValue - priceValue; 187 yourDiscount = WithVATBool ? new PriceInfo { PriceWithVAT = yourProfitValue }.PriceWithVATFormatted : new PriceInfo { PriceWithoutVAT = yourProfitValue }.PriceWithoutVATFormatted; 188 } 189 } 190 191 string retailPrice = ""; 192 bool displayRetailPrice = EcommerceConfiguration.DisplayRetailPrice; 193 if(EcommerceConfiguration.DisplayRetailPriceForUsers && Pageview.User == null) { 194 displayRetailPrice = false; 195 } 196 if(displayRetailPrice) { 197 string priceFieldName = EcommerceConfiguration.RetailPriceField; 198 if(EcommerceConfiguration.RetailPriceIsDbPrice) { 199 var prodService = new Dynamicweb.Ecommerce.Products.ProductService(); 200 var p = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, product.VariantId, Pageview.Area.EcomLanguageId); 201 PriceContext customerPriceContext = new PriceContext(Dynamicweb.Ecommerce.Common.Context.Currency, Dynamicweb.Ecommerce.Common.Context.Country, null, null, Dynamicweb.Ecommerce.Common.Context.ReverseChargeForVatEnabled, DateTime.Now); 202 var customerPrice = p?.GetPrice(customerPriceContext); 203 if(customerPrice.Price > 0) { 204 retailPrice = WithVATBool ? customerPrice.PriceWithVATFormatted : customerPrice.PriceWithoutVATFormatted; 205 } 206 } else if(!string.IsNullOrWhiteSpace(priceFieldName)) { 207 double customerPriceValue = 0.0; 208 if (product.ProductFields.TryGetValue(priceFieldName, out var fieldValue) && fieldValue.Value is double) { 209 customerPriceValue = (double)fieldValue.Value; 210 } 211 if(customerPriceValue > 0) { 212 retailPrice = WithVATBool ? new PriceInfo { PriceWithVAT = customerPriceValue }.PriceWithVATFormatted : new PriceInfo { PriceWithoutVAT = customerPriceValue }.PriceWithoutVATFormatted; 213 } 214 } 215 } 216 217 string yourProfitLabel = Translate("Productdetail.YourProfitLabel", "Uw voordeel:"); 218 219 Dynamicweb.Content.Commenting.CommentCollection comments = Dynamicweb.Content.Commenting.Comment.GetComments("ecomProduct", product.Id, Pageview.Area.EcomLanguageId); 220 double? productRating = product.Rating; 221 int productCommentCount = comments.Count; 222 223 bool isVariant = product.VariantId != ""; 224 int variantCount = product?.VariantInfo?.VariantInfo?.Count ?? 0; 225 bool hasVariants = !isVariant ? variantCount > 0 : false; 226 227 List<FieldOptionValueViewModel> productRibbons = null; 228 if (product.ProductFields["ProductRibbon"] != null) 229 { 230 productRibbons = (List<FieldOptionValueViewModel>)product.ProductFields["ProductRibbon"].Value; 231 } 232 233 bool isQuoteOnlyProduct = false; 234 if (product.ProductFields.TryGetValue("QuoteOnlyProduct", out var quoteOnlyField) && quoteOnlyField.Value is bool) 235 { 236 isQuoteOnlyProduct = (bool)quoteOnlyField.Value; 237 if(isQuoteOnlyProduct) 238 { 239 enableProductShoppingCart = false; 240 displayProductPrice = false; 241 } 242 } 243 244 <li class="products-module__slider-cell"> 245 <div class="products-module products-module__slider-cell__innerwrapper"> 246 247 @if(enableProductCompare || enableProductFavorites) 248 { 249 <div class="products-module__actions products-module__actions--showonhover"> 250 @if (enableProductCompare) 251 { 252 @renderProductCompareButton(productId, productName, productImage) 253 } 254 @if (enableProductFavorites) 255 { 256 @renderProductFavoriteButton(productId, productVariantId, productName, productNumber, gtmDiscount, gtmPrice, gtmValue, gtmCategoryName, productManufacturer, listId, listName) 257 } 258 </div> 259 } 260 261 @foreach(var rib in productRibbons) { 262 <p class="products-module__ribbon"> 263 <span class="products-module__ribbon-text">@rib.Value</span> 264 </p> 265 } 266 267 <figure class="products-module__image-container"> 268 @if(!string.IsNullOrWhiteSpace(productImage)) 269 { 270 <img src="/Admin/Public/GetImage.ashx?Image=@productImage&Crop=7&Format=webp&Quality=90&Compression=80&Height=200" alt="@productName" loading="lazy" height="200" width="300" /> 271 } 272 </figure> 273 274 <h3 class="products-module__product-name"> 275 @if(!string.IsNullOrWhiteSpace(productManufacturer)) 276 { 277 <span class="products-module__product-name--manufacturer">@productManufacturer</span> 278 } 279 <span class="products-module__product-name--product">@productName</span> 280 </h3> 281 282 @if(!string.IsNullOrWhiteSpace(productNumber)) 283 { 284 <p class="products-module__product-article-number">@productNumber</p> 285 } 286 287 @if (productCommentCount > 0) 288 { 289 <div class="products-module__product-review-indicator"> 290 @renderReviewIndicator("#86C440", productRating, productCommentCount) 291 </div> 292 } 293 294 <div class="products-module__product-spacer"></div> 295 296 @if(hasVariants) 297 { 298 <div class="products-module__product-variant-info"> 299 @if(variantCount == 1) 300 { 301 <p>@string.Format(Translate("ProductBlockVariantInfo.VariantCount.Single", "{0} variant"), variantCount)</p> 302 } 303 else 304 { 305 <p>@string.Format(Translate("ProductBlockVariantInfo.VariantCount.Multiple", "{0} variants"), variantCount)</p> 306 } 307 </div> 308 } 309 310 @if (displayPrice && displayProductPrice) 311 { 312 <div class="products-module__product-price-container"> 313 @if(hasVariants) 314 { 315 string minPrice = WithVATBool ? product.VariantInfo.PriceMin.PriceWithVatFormatted : product.VariantInfo.PriceMin.PriceWithoutVatFormatted; 316 string maxPrice = WithVATBool ? product.VariantInfo.PriceMax.PriceWithVatFormatted : product.VariantInfo.PriceMax.PriceWithoutVatFormatted; 317 if(minPrice != maxPrice) 318 { 319 <span class="products-module__product-price">@minPrice - @maxPrice</span> 320 } 321 else 322 { 323 <span class="products-module__product-price">@minPrice</span> 324 } 325 <span class="products-module__product-price-suffix">@ProductdetailPriceSuffix</span> 326 } 327 else 328 { 329 if (hasDiscount) 330 { 331 <span class="products-module__product-price-original">@OriginalPrice</span> 332 <span class="products-module__product-price">@Price</span> 333 } 334 else 335 { 336 <span class="products-module__product-price">@OriginalPrice</span> 337 } 338 <span class="products-module__product-price-suffix">@ProductdetailPriceSuffix</span> 339 if (!string.IsNullOrWhiteSpace(retailPrice)) 340 { 341 <p class="products-module__product-retail-price"> 342 @String.Format(Translate("ProductBlockTitle.RetailPrice", "Retail price: {0}"), retailPrice) 343 </p> 344 } 345 if (hasDiscount) 346 { 347 <p class="products-module__product-your-discount">@Translate("Productdetail.YourProfitLabel", "Uw voordeel:") @yourDiscount</p> 348 } 349 } 350 </div> 351 } 352 353 <section class="products-module__product-actions"> 354 @if (enableProductStock && !string.IsNullOrWhiteSpace(stockFormat)) 355 { 356 if(stockFormat == "text") { 357 if (!string.IsNullOrWhiteSpace(stockText)) 358 { 359 <p class="products-module__product-stock-state @stockClass">@string.Format(stockText, stockSize)</p> 360 } 361 } 362 else 363 { 364 string translationTag = ""; 365 if(neverOutOfStock) 366 { 367 translationTag = Translate("ProductBlockStockInfo.AmountInStock", "In stock"); 368 } 369 else if(stockSize == 1) 370 { 371 translationTag = Translate("ProductBlockStockInfo.AmountInStockSingle", "{0} product in stock"); 372 } 373 else if(stockSize > 1) 374 { 375 translationTag = Translate("ProductBlockStockInfo.AmountInStockMultiple", "{0} products in stock"); 376 } 377 else if(!isInStock) 378 { 379 translationTag = Translate("ProductBlockStockInfo.AmountOutOfStock", "Out of stock"); 380 } 381 <p class="products-module__product-stock-state @stockClass">@string.Format(translationTag, stockSizeFormatted)</p> 382 } 383 } 384 385 @if(!hasVariants && enableShoppingCart && enableProductShoppingCart) 386 { 387 <add-to-cart 388 class="app-addtocart" 389 data-prodid="@productId" 390 data-variantid="@productVariantId" 391 data-show-text="False" 392 data-min-quantity="@product.PurchaseMinimumQuantity" 393 data-step="@product.PurchaseQuantityStep" 394 data-list-id="@listId" 395 data-list-name="@listName"> 396 </add-to-cart> 397 } 398 else 399 { 400 <a href="@productURL" class="btn btn__primary products-module__more-infobtn"> 401 @if(hasVariants) 402 { 403 <span class="btn__text">@string.Format(Translate("ProductOverview.SeeAllVariants", "View variants"), variantCount)</span> 404 } 405 else 406 { 407 <span class="btn__text">@Translate("ProductOverview.MoreInformation", "More Information")</span> 408 } 409 <i class="btn__icon fal fa-arrow-right"></i> 410 </a> 411 } 412 </section> 413 414 <a href="@productURL" class="products-module__link" data-id="@productId" data-variantid="@productVariantId" data-number="@productNumber" data-name='@productName.Replace("''", "\\\"").Replace("'", "")' data-position="@index" data-brand='@gtmBrand' data-category='@gtmCategoryName' data-listid="@listId" data-listname="@listName" data-gtmprice="@gtmPrice" data-gtmdiscount="@gtmDiscount" data-gtmvalue="@gtmValue" data-currencycode="@Dynamicweb.Ecommerce.Common.Context.Currency.Code" aria-label="@productName"></a> 415 </div> 416 </li> 417 } 418 419 @helper renderReviewIndicator(string progressbarColor, double? value, int commentCount = 0) 420 { 421 string ratingPercentage = ((100 / 5) * value).ToString() + "%"; 422 string reviewTranslationKey = Translate("Reviews.Amount.Multiple", "{0} reviews"); 423 if(commentCount == 1) { 424 reviewTranslationKey = Translate("Reviews.Amount.Singular", "{0} review"); 425 } 426 427 <section style="display: flex; flex-direction: row; position: relative; align-items: center;"> 428 <div class="reviews__indicator" style="display: flex; flex-direction: row;"> 429 <div class="reviews__indicator-progressbar" style="width: @ratingPercentage; background-color: @progressbarColor;"></div> 430 <ul class="reviews__indicator-star-list"> 431 <li class="reviews__indicator-star-list-item"></li> 432 <li class="reviews__indicator-star-list-item"></li> 433 <li class="reviews__indicator-star-list-item"></li> 434 <li class="reviews__indicator-star-list-item"></li> 435 <li class="reviews__indicator-star-list-item"></li> 436 </ul> 437 </div> 438 <span style="display: flex; position: relative; font-size: 12px; line-height: initial;"> 439 @value / 5 (@string.Format(reviewTranslationKey, commentCount)) 440 </span> 441 </section> 442 } 443 444 @helper renderProductCompareButton(string productId, string name, string thumbnail) { 445 string title = Translate("ProductBlockAction.Compare", "Add to product compare"); 446 447 <button class="products-module__action-btn po-block__action-btn--compare" aria-label="@title" title="@title" data-prodid="@productId" data-imgsmall="@thumbnail" data-prodname="@name"> 448 <i class="fas fa-exchange-alt"></i> 449 </button> 450 } 451 452 @helper renderProductFavoriteButton(string productId, string variantId, string productName, string productNumber, string gtmDiscount, string gtmPrice, string gtmValue, string productCategoryName, string productManufacturer, string listId, string listName) { 453 if(string.IsNullOrWhiteSpace(variantId)) { 454 variantId = ""; 455 } 456 457 string title = Translate("ProductBlockAction.Wishlist", "Add to wish list"); 458 bool isActive = Dynamicweb.Ecommerce.CustomerExperienceCenter.Favorites.UserExtensions.IsProductInAnyFavoriteList(Pageview.User, productId, variantId); 459 string activeclass = isActive ? "po-block__action-btn--visible" : ""; 460 461 <button class="products-module__action-btn po-block__action-btn--wishlist @activeclass" aria-label="@title" title="@title" data-productid="@productId" data-variantid="@variantId" data-offcanvas-target="favoritelist" data-productid="@productId" data-variantid="@variantId" data-number="@productNumber" data-name='@productName' data-position="1" data-brand='@productManufacturer' data-category='@productCategoryName' data-listid="@listId" data-listname="@listName" data-gtmprice="@gtmPrice" data-gtmdiscount="@gtmDiscount" data-gtmvalue="@gtmValue" data-currencycode="@Dynamicweb.Ecommerce.Common.Context.Currency.Code"> 462 @if(isActive) { 463 <i class="fas fa-heart"></i> 464 } else { 465 <i class="far fa-heart"></i> 466 } 467 </button> 468 } 469