NECKLACE 925

Item number

CL1008,70
171 € In stock

Price:
Suggested retail price:

Error executing template "Designs/Swift/Paragraph/Swift_ProductPriceTableCustom.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_51f4336f934c431a964986de24532785.Execute() in D:\dynamicweb.net\Solutions\Dynamicweb\scrouples.cloud.dynamicweb-cms.com\files\Templates\Designs\Swift\Paragraph\Swift_ProductPriceTableCustom.cshtml:line 90
   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 4 @{ 5 bool isVisualEditor = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) ? Convert.ToBoolean(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) : false; 6 7 ProductViewModel product = new ProductViewModel(); 8 9 ProductViewModelSettings productSetting = new ProductViewModelSettings 10 { 11 LanguageId = Dynamicweb.Ecommerce.Common.Context.LanguageID, 12 CurrencyCode = Dynamicweb.Ecommerce.Common.Context.Currency.Code, 13 CountryCode = Dynamicweb.Ecommerce.Common.Context.Country.Code2, 14 ShopId = Pageview.Area.EcomShopId 15 }; 16 17 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Ecommerce.DynamicwebLiveIntegration.TemplatesHelper.IsLazyLoadingForProductInfoEnabled; 18 19 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 20 { 21 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 22 } else if (Pageview.Item["DummyProduct"] != null) { 23 24 string dummyProductId = ""; 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 if (productList.Products != null) 28 { 29 foreach (var p in productList.Products) { dummyProductId = p.Id; } 30 ProductViewModel dummyProduct = dummyProductId != "" ? ViewModelFactory.CreateView(productSetting, dummyProductId) : new ProductViewModel(); 31 product = dummyProduct; 32 } else { 33 product = ViewModelFactory.CreateView(productSetting, Dynamicweb.Ecommerce.Services.Products.GetLastActiveProducts(1, Dynamicweb.Ecommerce.Common.Context.LanguageID, false).FirstOrDefault().Id); 34 } 35 } else if (Pageview.Item["DummyProduct"] == null) { 36 product = ViewModelFactory.CreateView(productSetting, Dynamicweb.Ecommerce.Services.Products.GetLastActiveProducts(1, Dynamicweb.Ecommerce.Common.Context.LanguageID, false).FirstOrDefault().Id); 37 } 38 39 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", ""); 40 bool anonymousUser = Pageview.User == null; 41 bool hidePrice = anonymousUsersLimitations.Contains("price") && anonymousUser; 42 hidePrice = Pageview.IsVisualEditorMode ? false : hidePrice; 43 44 if (Pageview.IsVisualEditorMode && product.Prices.Count == 0) { 45 product.Prices.Add(new PriceListViewModel { Price = new PriceViewModel { Price = 95, PriceFormatted = "€95" }, Quantity = 1 }); 46 product.Prices.Add(new PriceListViewModel { Price = new PriceViewModel { Price = 85, PriceFormatted = "€85" }, Quantity = 2 }); 47 } 48 49 string layout = Model.Item.GetRawValueString("Layout", "list"); 50 } 51 52 @if (!hidePrice && product.Prices.Count > 0 && product.Id != null) { 53 if (isLazyLoadingForProductInfoEnabled) { 54 <div class="product-prices-container d-none" data-show-if="LiveProductInfo.product.Prices.length > 0"> 55 @if (layout == "list") { 56 <div class="product-prices item_@Model.Item.SystemName.ToLower() list"> 57 <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> 58 </div> 59 } else if (layout == "table") { 60 <div class="item_@Model.Item.SystemName.ToLower() grid"> 61 <table class="table table-sm mt-3 g-col-12 g-col-lg-6"> 62 <thead> 63 <tr> 64 <td>@Translate("QTY")</td> 65 <td>@Translate("pr. PCS")</td> 66 </tr> 67 </thead> 68 <tbody class="product-prices"> 69 <tr class="product-prices-template"> 70 <td class="js-text-price-quantity"></td> 71 <td class="js-text-price-price"></td> 72 </tr> 73 </tbody> 74 </table> 75 </div> 76 } 77 </div> 78 } 79 else 80 { 81 if (layout == "list") { 82 int count = 0; 83 <div class="item_@Model.Item.SystemName.ToLower() list"> 84 @foreach (PriceListViewModel quantityPrice in product.Prices) 85 { 86 string quantityLabel = ""; 87 if (product.DefaultUnitId != "Unit_STK" && !string.IsNullOrEmpty(product.DefaultUnitId) && product.DefaultUnitId!=null) 88 { 89 var variantOptionService = new Dynamicweb.Ecommerce.VariantOptionService(); 90 quantityLabel =variantOptionService.GetVariantOption(product.DefaultUnitId).Name; 91 } 92 else 93 { 94 quantityLabel = Translate("PCS"); 95 } 96 string quantityPriceSuffix = quantityPrice.Quantity > 1 ? Translate("pr. PCS") : ""; 97 if (count == 0) 98 { 99 <small class="d-block opacity-75"> 100 <span>@quantityPrice.Quantity @quantityLabel</span> - 101 @if (quantityPrice.Price.Price != product.Price.Price) 102 { 103 <span class="text-decoration-line-through opacity-75"> 104 <span class="text-price">@quantityPrice.Price.PriceFormatted @quantityPriceSuffix</span> 105 </span><span>&nbsp;</span> 106 } 107 <span class="fw-bold">@product.Price.PriceFormatted @quantityPriceSuffix</span> 108 </small> 109 } 110 else 111 { 112 <small class="d-block opacity-75"><span>@quantityPrice.Quantity @quantityLabel</span> - <span class="fw-bold">@quantityPrice.Price.PriceFormatted @quantityPriceSuffix</span></small> 113 } 114 count++; 115 } 116 </div> 117 } else if (layout == "table") { 118 <div class="item_@Model.Item.SystemName.ToLower() grid"> 119 <table class="table table-sm mt-3 g-col-12 g-col-lg-6"> 120 <thead> 121 <tr> 122 <td>@Translate("QTY")</td> 123 <td>@Translate("pr. PCS")</td> 124 </tr> 125 </thead> 126 <tbody> 127 @foreach (PriceListViewModel quantityPrice in product.Prices) 128 { 129 <tr> 130 <td>@quantityPrice.Quantity</td> 131 <td>@quantityPrice.Price.PriceFormatted</td> 132 </tr> 133 } 134 </tbody> 135 </table> 136 </div> 137 } 138 } 139 } else if (isVisualEditor) { 140 <div class="alert alert-dark m-0" role="alert"> 141 <span>@Translate("No products available")</span> 142 </div> 143 } 144
Stock low

Details

Brand
Scrouples
Pearls
No
Standardvare
No
EAN
5704012393130
Campaign
Black Friday
By clicking 'Accept All' you consent that we may collect information about you for various purposes, including: Functionality, Statistics and Marketing