PCI Durapox Premium 21 helgrijs emmer 2 kg

202207261
Error executing template "/Designs/Swift/Paragraph/CMI_ProductPriceTable.cshtml"
System.IO.IOException: The process cannot access the file 'D:\inetpub\wwwroot\www.cmi-nederland.nl\Application\Files\Templates\Designs\Swift\Translations.xml' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Dynamicweb.Rendering.Translation.Source.WriteDocument(XmlDocument document)
   at Dynamicweb.Rendering.Translation.Source.Save()
   at Dynamicweb.Rendering.Translation.Source.UpdateTranslationSource(Source source, IEnumerable`1 newKeys, String designName, IEnumerable`1 cultures)
   at Dynamicweb.Rendering.Template.TranslateText(String text, String defaultValue, String cultureName)
   at Dynamicweb.Rendering.TemplateBase`1.Translate(String text, String defaultValue)
   at CompiledRazorTemplates.Dynamic.RazorEngine_cd4776760ee648499d570fbaa26d2d77.Execute() in D:\inetpub\wwwroot\www.cmi-nederland.nl\Application\Files\Templates\Designs\Swift\Paragraph\CMI_ProductPriceTable.cshtml:line 67
   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 Dynamicweb.Ecommerce.ProductCatalog 3 @using Application.CustomCode.Helpers; 4 @using Dynamicweb.Ecommerce.Prices; 5 @{ 6 bool isVisualEditor = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) ? Convert.ToBoolean(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) : false; 7 8 ProductViewModel product = new ProductViewModel(); 9 10 ProductViewModelSettings productSetting = new ProductViewModelSettings 11 { 12 LanguageId = Dynamicweb.Ecommerce.Common.Context.LanguageID, 13 CurrencyCode = Dynamicweb.Ecommerce.Common.Context.Currency.Code, 14 CountryCode = Dynamicweb.Ecommerce.Common.Context.Country.Code2, 15 ShopId = Pageview.Area.EcomShopId 16 }; 17 18 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]); 19 20 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 21 { 22 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 23 } 24 else if (Pageview.Item["DummyProduct"] != null) 25 { 26 27 string dummyProductId = ""; 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 if (productList.Products != null) 31 { 32 foreach (var p in productList.Products) { dummyProductId = p.Id; } 33 ProductViewModel dummyProduct = dummyProductId != "" ? ViewModelFactory.CreateView(productSetting, dummyProductId) : new ProductViewModel(); 34 product = dummyProduct; 35 } 36 else 37 { 38 product = ViewModelFactory.CreateView(productSetting, Dynamicweb.Ecommerce.Services.Products.GetLastActiveProducts(1, Dynamicweb.Ecommerce.Common.Context.LanguageID, false).FirstOrDefault().Id); 39 } 40 } 41 else if (Pageview.Item["DummyProduct"] == null) 42 { 43 product = ViewModelFactory.CreateView(productSetting, Dynamicweb.Ecommerce.Services.Products.GetLastActiveProducts(1, Dynamicweb.Ecommerce.Common.Context.LanguageID, false).FirstOrDefault().Id); 44 } 45 46 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", ""); 47 bool anonymousUser = Pageview.User == null; 48 bool hidePrice = anonymousUsersLimitations.Contains("price") && anonymousUser; 49 hidePrice = Pageview.IsVisualEditorMode ? false : hidePrice; 50 51 if (Pageview.IsVisualEditorMode && product.Prices.Count == 0) 52 { 53 product.Prices.Add(new PriceListViewModel { Price = new PriceViewModel { Price = 95, PriceFormatted = "€95" }, Quantity = 1 }); 54 product.Prices.Add(new PriceListViewModel { Price = new PriceViewModel { Price = 85, PriceFormatted = "€85" }, Quantity = 2 }); 55 } 56 57 string layout = Model.Item.GetRawValueString("Layout", "list"); 58 59 var shownUnit = ""; 60 var defaultUnitName = ""; 61 var defaultUnitOfMeasure = Dynamicweb.Ecommerce.Services.UnitOfMeasure.GetUnitOfMeasures(product.Id)?.FirstOrDefault(uom => uom.IsBaseUnit); 62 if (defaultUnitOfMeasure != null) 63 { 64 defaultUnitName = Dynamicweb.Ecommerce.Services.Variants.GetUnitName(defaultUnitOfMeasure.UnitId, Dynamicweb.Ecommerce.Common.Context.LanguageID); 65 if (!string.IsNullOrEmpty(defaultUnitName)) 66 { 67 shownUnit = Translate($"PricePer_{defaultUnitName}", $"/{defaultUnitName}"); 68 } 69 } 70 71 IEnumerable<Dynamicweb.Ecommerce.Stocks.UnitOfMeasure> unitOfMeasures = null; 72 var customerSpecificPrices = CmiTablePriceHelper 73 .GetTablePricesByCustomer( 74 Dynamicweb.Security.UserManagement.User.GetCurrentFrontendUser(), 75 product, 76 1, 77 Dynamicweb.Ecommerce.Common.Context.LanguageID, out unitOfMeasures); 78 79 if (customerSpecificPrices != null && customerSpecificPrices?.Any() == true) 80 { 81 var firstCustomerPrice = customerSpecificPrices.First(); 82 var customerSpecificPriceUnit = Dynamicweb.Ecommerce.Services.Variants.GetUnitName( 83 firstCustomerPrice.UnitId, 84 Dynamicweb.Ecommerce.Common.Context.LanguageID); 85 86 if (!string.IsNullOrEmpty(customerSpecificPriceUnit)) 87 { 88 shownUnit = Translate($"PricePer_{customerSpecificPriceUnit}", 89 $"/{customerSpecificPriceUnit}"); 90 } 91 } 92 93 List<Price> cleanedPrices = new List<Price>(); 94 if (customerSpecificPrices != null && customerSpecificPrices?.Any() == true && product.Id != null) 95 { 96 var lastQuantity = -1.0D; // values are 0-based 97 var lastPrice = 0D; 98 foreach (var p in customerSpecificPrices) 99 { 100 if (p.Quantity == lastQuantity || p.Amount == lastPrice) 101 { 102 continue; 103 } 104 cleanedPrices.Add(p); 105 lastQuantity = p.Quantity; 106 lastPrice = p.Amount; 107 } 108 } 109 } 110 @if (!hidePrice && product.Id != null && cleanedPrices.Any()) 111 { 112 if (isLazyLoadingForProductInfoEnabled) 113 { 114 <div class="product-prices-container d-none" data-show-if="LiveProductInfo.product.Prices.length > 0"> 115 @if (layout == "list") 116 { 117 <div class="product-prices item_@Model.Item.SystemName.ToLower() list"> 118 <small class="d-block opacity-75 product-prices-template"><span><span class="js-text-price-quantity"></span> @Translate("PCS")</span> - <span class="fw-bold"><span class="js-text-price-price"></span> <span class="d-none" data-show-if="LiveProductInfo.productPrice.Quantity > 1">@Translate("pr. PCS")</span></span></small> 119 </div> 120 } 121 else if (layout == "table") 122 { 123 <div class="item_@Model.Item.SystemName.ToLower() grid"> 124 <table class="table table-sm mt-3 g-col-12 g-col-lg-6"> 125 <thead> 126 <tr> 127 <td>@Translate("PriceTable_FromQty", "Vanaf aantal")@defaultUnitName</td> 128 <td>@Translate("PriceTable_PricePer", "Prijs per ")@shownUnit</td> 129 </tr> 130 </thead> 131 <tbody class="product-prices"> 132 <tr class="product-prices-template"> 133 <td class="js-text-price-quantity"></td> 134 <td class="js-text-price-price"></td> 135 </tr> 136 </tbody> 137 </table> 138 </div> 139 } 140 </div> 141 } 142 else 143 { 144 if (layout == "list") 145 { 146 <div class="item_@Model.Item.SystemName.ToLower() list"> 147 @foreach (Price quantityPrice in cleanedPrices) 148 { 149 var quantityLabel = shownUnit.TrimStart('/'); 150 var quantityPriceSuffix = quantityPrice.Quantity > 1 ? shownUnit : ""; 151 var amount = CmiPriceHelper.GetFormattedPrice(quantityPrice.Amount); 152 153 <small class="d-block opacity-75"><span>@quantityPrice.Quantity @quantityLabel</span> - 154 <span class="fw-bold">@amount @quantityPriceSuffix</span></small> 155 } 156 </div> 157 } 158 else if (layout == "table") 159 { 160 shownUnit = shownUnit.TrimStart('/'); 161 <div class="item_@Model.Item.SystemName.ToLower() grid"> 162 <table class="table table-sm mt-3 g-col-12 g-col-lg-6"> 163 <thead> 164 <tr> 165 <td>@Translate("PriceTable_FromQty", "Vanaf aantal") @defaultUnitName</td> 166 <td>@Translate("PriceTable_PricePer", "Prijs per") @shownUnit</td> 167 </tr> 168 </thead> 169 <tbody> 170 @foreach (Price quantityPrice in cleanedPrices) 171 { 172 var qty = quantityPrice.Quantity == 0 ? 1 : quantityPrice.Quantity; // values are 0-based 173 var amount = CmiPriceHelper.GetFormattedPrice(quantityPrice.Amount); 174 <tr> 175 <td>@qty</td> 176 <td>@amount</td> 177 </tr> 178 } 179 </tbody> 180 </table> 181 </div> 182 } 183 } 184 } 185 else if (isVisualEditor) 186 { 187 <div class="alert alert-dark m-0" role="alert"> 188 <span>@Translate("No products available")</span> 189 </div> 190 } 191

Bestelbaar

Door op 'Alles accepteren' te klikken, stemt u ermee in dat we informatie over u mogen verzamelen voor verschillende doeleinden, waaronder: Functionaliteit, Statistieken en Marketing