-25%
Balance Me Protect & Shine Shampoo, 250 ml.
Error executing template "Designs/Swift/Paragraph/Swift_ProductPrice.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_e29b096f7fd34d3c801258c02de6d805.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 4 @{ 5 ProductViewModel product = null; 6 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 7 { 8 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 9 } 10 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 11 { 12 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 13 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 14 15 if (productList?.Products is object) 16 { 17 product = productList.Products[0]; 18 } 19 } 20 21 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", ""); 22 bool anonymousUser = Pageview.User == null; 23 bool isErpConnectionDown = !Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsWebServiceConnectionAvailable"]); 24 bool hidePrice = anonymousUsersLimitations.Contains("price") && anonymousUser || Pageview.AreaSettings.GetBoolean("ErpDownHidePrices") && isErpConnectionDown; 25 26 bool productIsDiscontinued = product is object && product.Discontinued; 27 bool doNotShowPriceIfProductIsDiscontinued = false; 28 if (productIsDiscontinued){doNotShowPriceIfProductIsDiscontinued = Model.Item.GetBoolean("DoNotShowPriceIfProductIsDiscontinued");} 29 var isDiscontinued = productIsDiscontinued && doNotShowPriceIfProductIsDiscontinued; 30 31 // bool doNotShowPriceIfProductIsDiscontinued = Model.Item.GetBoolean("DoNotShowPriceIfProductIsDiscontinued"); 32 33 //var ProductDefaultPriceField = productObject.ProductFieldValues.GetProductFieldValue("ProductDefaultPrice"); 34 35 //double beforePriceCustomDouble = 0; 36 37 //if (ProductDefaultPriceField != null){ 38 // beforePriceCustomDouble = Math.Round(Convert.ToDouble(ProductDefaultPriceField.Value), 2); 39 //} 40 41 42 43 44 45 } 46 47 @if (product is object && !hidePrice && !isDiscontinued) { 48 var productObject = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, "", Pageview.Area.EcomLanguageId); 49 double defaultPrice = productObject.DefaultPrice; 50 defaultPrice = defaultPrice + (defaultPrice * product.Price.VATPercent / 100); 51 52 bool showInformativePrice = Model.Item.GetBoolean("ShowInformativePrice"); 53 string unitId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.Form.Get("UnitId")) ? Dynamicweb.Context.Current.Request.Form.Get("UnitId") : string.Empty; 54 55 string priceFontSize = Model.Item.GetRawValueString("PriceSize", "fs-2"); 56 string horizontalAlign = Model.Item.GetRawValueString("HorizontalAlignment", ""); 57 string layout = Model.Item.GetRawValueString("Layout", "horizontal"); 58 string textAlign = horizontalAlign == "center" ? "text-center" : string.Empty; 59 textAlign = horizontalAlign == "end" ? "text-end" : textAlign; 60 61 horizontalAlign = horizontalAlign == "center" && layout == "horizontal" ? "justify-content-center" : horizontalAlign; 62 horizontalAlign = horizontalAlign == "end" && layout == "horizontal" ? "justify-content-end" : horizontalAlign; 63 horizontalAlign = horizontalAlign == "center" && layout == "vertical" ? "align-items-center" : horizontalAlign; 64 horizontalAlign = horizontalAlign == "end" && layout == "vertical" ? "align-items-end" : horizontalAlign; 65 66 string flexDirection = layout == "horizontal" ? string.Empty : "flex-column"; 67 string flexGap = layout == "horizontal" ? "gap-3" : string.Empty; 68 string order = layout == "horizontal" ? string.Empty : "order-2"; 69 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? "theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 70 theme = GetViewParameter("theme") != null ? GetViewParameterString("theme") : theme; 71 72 string contentPadding = Model.Item.GetRawValueString("ContentPadding", ""); 73 contentPadding = contentPadding == "none" ? "p-0" : contentPadding; 74 contentPadding = contentPadding == "small" ? "p-1 px-md-2 py-md-1" : contentPadding; 75 contentPadding = contentPadding == "large" ? "p-2 px-md-3 py-md-2" : contentPadding; 76 77 string showPricesWithVat = Pageview.Area.EcomPricesWithVat.ToLower(); 78 bool neverShowVat = string.IsNullOrEmpty(showPricesWithVat); 79 80 string priceMin = ""; 81 string priceMax = ""; 82 83 string liveInfoClass = ""; 84 string productInfoFeed = ""; 85 86 var priceMatrix = Dynamicweb.Ecommerce.Services.Prices.GetByProductId(product.Id); 87 var beautyClubPrice = priceMatrix.FirstOrDefault(p => p.UserGroupId == "1165"); 88 89 if (beautyClubPrice != null) 90 { 91 if (product.Price.Price < beautyClubPrice.Amount) 92 { 93 beautyClubPrice = null; 94 } 95 <span hidden="true">beautyClubPrice: @beautyClubPrice.Amount</span> 96 } 97 <span hidden="true">product.Price.Price: @product.Price.Price</span> 98 <span hidden="true">priceMatrix counter: @priceMatrix?.Count()</span> 99 100 string currency = product.Price.CurrencyCode; 101 var dwCurrency = Dynamicweb.Ecommerce.Services.Currencies.GetCurrency(currency); 102 if (dwCurrency != null) 103 { 104 if (dwCurrency.UseCurrencyCodeForFormat) 105 { 106 currency = dwCurrency.Code; 107 } 108 else 109 { 110 currency = dwCurrency.Symbol; 111 } 112 } 113 114 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]); 115 if (isLazyLoadingForProductInfoEnabled) 116 { 117 if (Dynamicweb.Context.Current.Items.Contains("ProductInfoFeed")) 118 { 119 productInfoFeed = Dynamicweb.Context.Current.Items["ProductInfoFeed"]?.ToString(); 120 if (!string.IsNullOrEmpty(productInfoFeed)) 121 { 122 productInfoFeed = $"data-product-info-feed=\"{productInfoFeed}\""; 123 } 124 } 125 liveInfoClass = "js-live-info"; 126 } 127 128 <div class="@textAlign @liveInfoClass item_@Model.Item.SystemName.ToLower()" data-product-id="@product.Id" data-variant-id="@product.VariantId" @productInfoFeed> 129 @if (showInformativePrice && product.PriceInformative.Price != 0) 130 { 131 <div class="opacity-50"> 132 <span>@Translate("RRP") </span> 133 <span class="text-decoration-line-through text-price">@product.PriceInformative.PriceFormatted</span> 134 </div> 135 } 136 <div class="@priceFontSize m-0 d-flex flex-wrap @flexDirection @flexGap @horizontalAlign" style="row-gap: 0 !important" itemprop="offers" itemscope itemtype="https://schema.org/Offer"> 137 <span itemprop="priceCurrency" content="@product.Price.CurrencyCode" class="d-none"></span> 138 139 140 @if (showPricesWithVat == "false" && !neverShowVat) 141 { 142 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 143 { 144 <span itemprop="price" content="" class="d-none"></span> 145 <span class="text-decoration-line-through js-text-decoration-line-through opacity-75 me-3 text-price js-text-price d-none" data-show-if="LiveProductInfo.product.Price.Price != LiveProductInfo.product.PriceBeforeDiscount.Price"></span> 146 } 147 else 148 { 149 string beforePrice = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).PriceBeforeDiscount.PriceWithoutVatFormatted : product.PriceBeforeDiscount.PriceWithoutVatFormatted; 150 151 <span itemprop="price" content="@product.Price.PriceWithoutVat" class="d-none"></span> 152 if (product.Price.Price != product.PriceBeforeDiscount.Price) 153 { 154 <span class="text-decoration-line-through opacity-75 @order">@beforePrice</span> 155 } 156 } 157 } 158 else 159 { 160 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 161 { 162 <span itemprop="price" content="" class="d-none"></span> 163 <span class="text-decoration-line-through js-text-decoration-line-through opacity-75 me-3 text-price js-text-price d-none" data-show-if="LiveProductInfo.product.Price.Price != LiveProductInfo.product.PriceBeforeDiscount.Price"></span> 164 } 165 else 166 { 167 string beforePrice = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).PriceBeforeDiscount.PriceFormatted : product.PriceBeforeDiscount.PriceFormatted; 168 169 <span itemprop="price" content="@product.Price.Price" class="d-none"></span> 170 171 //if (product.Price.Price != beforePriceCustomDouble && product.Price.Price < beforePriceCustomDouble){ 172 173 if (product.Price.Price < defaultPrice && beautyClubPrice != null) 174 { 175 if (product.Price.Price == beautyClubPrice.Amount) 176 { 177 178 <span class="@order"> 179 <div class="fs-6">@Translate("Not a member")</div> 180 <div class="text-price text-decoration-line-through opacity-75">@defaultPrice.ToString("F2") @Translate(product.Price.CurrencyCode + "-shortname")</div> 181 </span> 182 183 } 184 else 185 { 186 <span class="@order"> 187 <div class="text-price text-decoration-line-through opacity-75">@defaultPrice.ToString("F2") @Translate(product.Price.CurrencyCode + "-shortname")</div> 188 </span> 189 } 190 191 } 192 193 if (product.Price.Price != defaultPrice && product.Price.Price < defaultPrice && beautyClubPrice == null) 194 { 195 <span class="@order"> 196 <div class="text-price text-decoration-line-through opacity-75">@defaultPrice.ToString("F2") @Translate(product.Price.CurrencyCode + "-shortname")</div> 197 </span> 198 } 199 200 201 else if (product.Price.Price != product.PriceBeforeDiscount.Price) 202 { 203 <span class="text-decoration-line-through opacity-75 @order"> 204 <span class="text-price">@beforePrice</span> 205 </span> 206 } 207 } 208 } 209 210 @if (showPricesWithVat == "false" && !neverShowVat) 211 { 212 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 213 { 214 <span class="text-price js-text-price"> 215 <span class="spinner-border" role="status"></span> 216 </span> 217 } 218 else 219 { 220 string price = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).Price.PriceWithoutVatFormatted : product.Price.PriceWithoutVatFormatted; 221 222 if (product?.VariantInfo?.VariantInfo != null) 223 { 224 priceMin = product?.VariantInfo?.PriceMin?.PriceWithoutVatFormatted != null ? product.VariantInfo.PriceMin.PriceWithoutVatFormatted : ""; 225 priceMax = product?.VariantInfo?.PriceMax?.PriceWithoutVatFormatted != null ? product.VariantInfo.PriceMax.PriceWithoutVatFormatted : ""; 226 } 227 if (priceMin != priceMax) 228 { 229 price = priceMin + " - " + priceMax; 230 } 231 <span class="@theme @contentPadding"> 232 <span class="text-price">@price</span> 233 </span> 234 } 235 } 236 else 237 { 238 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 239 { 240 <span class="text-price js-text-price"> 241 <span class="spinner-border" role="status"></span> 242 </span> 243 } 244 else 245 { 246 string price = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).Price.PriceFormatted : product.Price.PriceFormatted; 247 248 if (product?.VariantInfo?.VariantInfo != null) 249 { 250 priceMin = product?.VariantInfo?.PriceMin?.PriceFormatted != null ? product.VariantInfo.PriceMin.PriceFormatted : ""; 251 priceMax = product?.VariantInfo?.PriceMax?.PriceFormatted != null ? product.VariantInfo.PriceMax.PriceFormatted : ""; 252 } 253 if (priceMin != priceMax) 254 { 255 price = priceMin + " - " + priceMax; 256 } 257 258 if (beautyClubPrice != null && product.Price.Price == beautyClubPrice.Amount) 259 { 260 <span class="@theme @contentPadding"> 261 <div class="fs-6 text-beautyclub">@Translate("Beauty club member")</div> 262 <div class="@theme @contentPadding text-beautyclub"> 263 <span class="text-price">@price</span> 264 </div> 265 </span> 266 } 267 else 268 { 269 <span class="@theme @contentPadding"> 270 @if (beautyClubPrice != null) 271 { 272 if (product.Price.Price == defaultPrice) 273 { 274 <div class="fs-6">@Translate("Not a member")</div> 275 } 276 } 277 <div class="text-price">@price</div> 278 </span> 279 } 280 } 281 } 282 @if (beautyClubPrice != null && product.Price.Price > beautyClubPrice.Amount && product.Price.Price == defaultPrice) 283 { 284 <span class="@theme @contentPadding"> 285 <div class="fs-6 text-beautyclub">@Translate("Beauty club member")</div> 286 <div class="@theme @contentPadding text-beautyclub"> 287 <span class="text-price">@beautyClubPrice.Amount.ToString("F2") @currency</span> 288 </div> 289 </span> 290 } 291 292 293 @* Stock state for Schema.org, start *@ 294 @{ 295 Uri url = Dynamicweb.Context.Current.Request.Url; 296 } 297 298 <link itemprop="url" href="@url"> 299 300 @{ 301 bool IsNeverOutOfStock = product.NeverOutOfstock; 302 } 303 304 @if (IsNeverOutOfStock) 305 { 306 <span itemprop="availability" class="d-none">@Translate("Available in stock")</span> 307 } 308 else 309 { 310 if (product.StockLevel > 0) 311 { 312 <span itemprop="availability" class="d-none">InStock</span> 313 } 314 else 315 { 316 <span itemprop="availability" class="d-none">OutOfStock</span> 317 } 318 } 319 @* Stock state for Schema.org, stop *@ 320 321 </div> 322 323 @if (showPricesWithVat == "false" && !neverShowVat) 324 { 325 if (isLazyLoadingForProductInfoEnabled && !Pageview.IsVisualEditorMode) 326 { 327 <small class="opacity-85 fst-normal js-text-price-with-vat d-none" data-suffix="@Translate("Incl. VAT")"></small> 328 } 329 else 330 { 331 string price = !string.IsNullOrEmpty(unitId) ? product.GetPrice(unitId).Price.PriceWithVatFormatted : product.Price.PriceWithVatFormatted; 332 333 if (product?.VariantInfo?.VariantInfo != null) 334 { 335 priceMin = product?.VariantInfo?.PriceMin?.PriceWithVatFormatted != null ? product.VariantInfo.PriceMin.PriceWithVatFormatted : ""; 336 priceMax = product?.VariantInfo?.PriceMax?.PriceWithVatFormatted != null ? product.VariantInfo.PriceMax.PriceWithVatFormatted : ""; 337 } 338 if (priceMin != priceMax) 339 { 340 price = priceMin + " - " + priceMax; 341 } 342 <small class="opacity-85 fst-normal">@price @Translate("Incl. VAT")</small> 343 } 344 } 345 </div> 346 } 347 else if (Pageview.IsVisualEditorMode) 348 { 349 <div class="alert alert-dark m-0" role="alert"> 350 <span>@Translate("No products available")</span> 351 </div> 352 } 353
Ikke på lager
Du vil blive kontaktet, når produktet er tilbage på lager.
Bestil før kl. 13 - afsendes i dag!
Forventet levering: 1-2 dage
Fri fragt over 599 kr. - ellers fra 39 kr.
30 dages returret
-
Balance Me Protect & Shine Shampoo, 250 ml. er en sulfatefri shampoo, der giver nyt liv til beskadiget hår. Med ingredienser som beroligende kamille, aloe vera og sort peber, øges cirkulationen i hovedbunden, og håret bliver mere sundt, stærkere og mere blankt. Velegnet til alle hårtyper samt sart hovedbund.
- Påfør i vådt hår og masser ind i hovedbunden for øgelse af cirkulationen.
Ingredienser | Fri for mineralske olier Fri for farvestoffer Fri for silikone Ikke testet på dyr |
Størrelse | 250 ml. |