keyboard_arrow_down

Säilytys ja laukut

Isabellalla on laaja valikoima tavaransäilytyspaikkoja ja laukkuja, mitkä helpottavat pikkutavaroiden löytymistä leirintäalueella.

Error executing template "Designs/isabella/eCom/Productlist/espresso.cshtml"
System.ArgumentNullException: Value cannot be null.
Parameter name: original
at Co3.Isabella.Dw.Models.FrontEnd.Ecommerce.IsabellaProductImageUrl..ctor(String original, Int32 type, Int32 groupId) in C:\git\isabella\Co3.Isabella.Dynamicweb\Models\FrontEnd\Ecommerce\IsabellaProductImageUrl.cs:line 41
at Co3.Isabella.Dw.Services.ProductService.GetImagePrimary(Product product) in C:\git\isabella\Co3.Isabella.Dynamicweb\Services\ProductService.cs:line 287
at CompiledRazorTemplates.Dynamic.RazorEngine_a98d29861832439fa3513222f080ce59.<>c__DisplayClass8_0.<ProductlistItem>b__0(TextWriter __razor_helper_writer) in F:\dynamicweb.net\Solutions\isabella.espresso4.dk\Files\Templates\Designs\isabella\eCom\Productlist\espresso.cshtml:line 220
at CompiledRazorTemplates.Dynamic.RazorEngine_a98d29861832439fa3513222f080ce59.Execute() in F:\dynamicweb.net\Solutions\isabella.espresso4.dk\Files\Templates\Designs\isabella\eCom\Productlist\espresso.cshtml:line 367
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 Co3.Espresso.Website.TemplateBases.Paragraphs.Module 2 3 @using Co3.Espresso.Base.Extensions 4 @using Co3.Espresso.Website.Models.FrontEnd 5 @using Co3.Espresso.Website.Services 6 @using Dynamicweb.Content 7 @using Dynamicweb.Content.Items.Metadata 8 @using Dynamicweb.Content.Items 9 @using Dynamicweb.Frontend 10 @using System.Web 11 @using System.Web.Util 12 @using Co3.Espresso.Website.Services 13 @using Dynamicweb.Ecommerce 14 15 @using Dynamicweb.Ecommerce.Products 16 @using ParagraphService = Co3.Espresso.Website.Services.ParagraphService 17 @using ProductService = Co3.Espresso.Website.Services.ProductService 18 19 @using System.Globalization 20 @using System.Security.Cryptography.X509Certificates 21 @using System.Web.Razor.Parser.SyntaxTree 22 @using Co3.Espresso.Base.Extensions 23 @using Co3.Espresso.Website.Models.FrontEnd 24 @using Co3.Espresso.Website.Services 25 @using Co3.Isabella.Dw.Models.FrontEnd.Ecommerce 26 @using Dynamicweb.Content 27 @using Dynamicweb.Ecommerce.Products 28 @using Dynamicweb.Frontend 29 @using Dynamicweb.Rendering 30 @using Dynamicweb.Rendering.Translation 31 @using Dynamicweb.SystemTools 32 @using EcomContext = Dynamicweb.Ecommerce.Common.Context 33 @using eProductService = Co3.Espresso.Website.Services.ProductService 34 @using Page = Dynamicweb.Content.Page 35 @using PageService = Dynamicweb.Content.PageService 36 37 @functions { 38 39 public string getCountryCodeFromArea(Area area) 40 { 41 RegionInfo regionInfo = new RegionInfo( area.CultureInfo.LCID ); 42 return regionInfo.TwoLetterISORegionName; 43 } 44 45 public string getCheckoutSetup(string shopType = "") 46 { 47 bool isB2bCheckout = PageView.Current().User != null; 48 if (isB2bCheckout) 49 { 50 return "shipping,customer,approve"; 51 } else if (shopType == "B2C") 52 { 53 return "shipping,payment,approve"; 54 } else if (shopType == "Outlet") 55 { 56 return "shipping,customer,payment,approve"; 57 } 58 59 return "customer,approve"; 60 } 61 62 public static string GetStandardCollapseToggleTextExpand() 63 { 64 return "Se mere"; 65 } 66 67 public static string GetStandardCollapseToggleTextCollapse() 68 { 69 return "Se mindre"; 70 } 71 72 public string getModelTypeLink() 73 { 74 bool isUserAuthenticated = PageView.Current().User != null; 75 string eComCountryCode = PageView.Current().Area.Item[ "EcommerceCountryCode" ] != null ? PageView.Current().Area.Item[ "EcommerceCountryCode" ].ToString() : ""; 76 string returnValue = string.Empty; 77 78 if ( isUserAuthenticated == false ) 79 { 80 if ( string.IsNullOrEmpty(eComCountryCode) == false) 81 { 82 { 83 returnValue = string.Format( "Ecom:Product.CategoryField.ModelType.ModelTypeLink_{0}.Value", eComCountryCode ); 84 } 85 } 86 else 87 { 88 returnValue = "Ecom:Product.CategoryField.ModelType.ModelTypeLink.Value"; 89 } 90 } 91 else 92 { 93 if ( string.IsNullOrEmpty(eComCountryCode) == false) 94 { 95 { 96 returnValue = string.Format( "Ecom:Product.CategoryField.ModelType.ModelTypeLinkB2B_{0}.Value", eComCountryCode ); 97 } 98 } 99 else 100 { 101 returnValue = "Ecom:Product.CategoryField.ModelType.ModelTypeLinkB2B.Value"; 102 } 103 } 104105 return returnValue; 106 } 107108 } 109110 @helper ProductDescription(string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null) 111 { 112 if ( string.IsNullOrEmpty( content ) == false ) 113 { 114 ClassList headingClassList = new ClassList(); 115 headingClassList.AddClasses( "col-12" ); 116 ClassList contentClassList = new ClassList(); 117 contentClassList.AddClasses( "col-12" ); 118119 @sectionStart( sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses, collapseToggleTextCollapse: collapseToggleTextCollapse, collapseToggleTextExpand: collapseToggleTextExpand ) 120121 if ( string.IsNullOrEmpty( heading ) == false ) 122 { 123 <div class="@headingClassList"> 124 <h2>@heading</h2> 125 </div> 126 } 127 <div class="@contentClassList"> 128 @content 129 </div> 130131 @sectionEnd() 132 } 133 } 134135136 @helper ProductVideo(string sectionClasses = "e-section", string contentClasses = null, string heading = null, string videoURL = null) 137 { 138 if ( string.IsNullOrEmpty( videoURL ) == false ) 139 { 140 ClassList headingClassList = new ClassList(); 141 headingClassList.AddClasses( "col-12" ); 142 ClassList contentClassList = new ClassList(); 143 contentClassList.AddClasses( "col-12" ); 144145146 @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) 147148 if ( string.IsNullOrEmpty( heading ) == false ) 149 { 150 <div class="@headingClassList"> 151 <h2>@heading</h2> 152 </div> 153 } 154155 <div class="@contentClassList"> 156 <div class="embed-responsive embed-responsive-16by9 mb-2"> 157 <iframe class="embed-responsive-item" src="@videoURL" width="1080" height="608" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> 158 </div> 159 </div> 160 @sectionEnd() 161 } 162 } 163164 @helper ProductRelatedProducts(string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null, 165 IEnumerable< Product > productLoop = null) 166 { 167 if ( productLoop != null && productLoop.Any() == true ) 168 { 169 ClassList headingClassList = new ClassList(); 170 headingClassList.AddClasses( "col-12" ); 171 ClassList contentClassList = new ClassList(); 172 contentClassList.AddClasses( "col-12" ); 173174 @sectionStart( sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses, collapseToggleTextCollapse: collapseToggleTextCollapse, collapseToggleTextExpand: collapseToggleTextExpand ) 175176 if ( string.IsNullOrEmpty( heading ) == false ) 177 { 178 <div class="@headingClassList"> 179 <h4 class="isabella-text-bullets-left mb-3">@heading</h4> 180 </div> 181 } 182 <div class="@contentClassList"> 183 <div class="e-products mb-2"> 184 <div class="row"> 185 @{ 186 string productlistItemClassList = "col-12 col-sm-6 col-md-3 col-lg-3 col-xl-3"; 187 } 188 @foreach ( Product product in productLoop.Where(p => p.Groups.Any(g => g.ShopId.Equals("SHOP1")) && (bool) p.GetCategoryValue( "ProductsGeneral", "PIMActive" ) != false && (bool) p.ShowInProductList && p.Active) ) 189 { 190 @ProductlistItem(product, productlistItemClassList) 191 } 192 </div> 193 </div> 194 </div> 195196 @sectionEnd() 197 } 198 } 199200201 @helper ProductlistItem(Product product, string productlistItemClassList = null, string isModelProductList = null) 202 { 203 Dynamicweb.Ecommerce.Products.ProductService dwProductService = new Dynamicweb.Ecommerce.Products.ProductService(); 204 string shopType = PageView.Current().Area.Item["ShopType"]?.ToString(); 205 string productLink = eProductService.Instance.GetProductLink( product.GetDefaultGroupByShopId( product.DefaultShopId ).Id, product.Id, product.VariantId ); 206207208 productLink = SearchEngineFriendlyURLs.GetFriendlyUrl( productLink ); 209210 if (shopType == "Outlet") 211 { 212 Page page = new PageService().GetPageByNavigationTag(PageView.Current().AreaID, "outletdisplaypage"); 213 if (page != null) 214 { 215 productLink = SearchEngineFriendlyURLs.GetFriendlyUrl( $"Default.aspx?ID={page.ID}&productId={product.Id}" ); 216 } 217218 } 219220 IsabellaProductImageUrl primaryImage = Co3.Isabella.Dw.Services.ProductService.Instance.GetImagePrimary(product); 221 List<IsabellaProductImageUrl> detailsImages = Co3.Isabella.Dw.Services.ProductService.Instance.GetImageDetails(product); 222 string detailsImage = detailsImages?.FirstOrDefault( pd => pd.Type == 0 && pd.GroupId == 4 )?.Medium ?? string.Empty; 223224 //string productlistDetailImage = product.Details.FirstOrDefault( pd => pd.Type == 0 && pd.GroupId == 4 )?.Value; 225226227228 string image = "/Files/Templates/Designs/isabella/_assets/img/NoImage.gif"; 229230 if (primaryImage != null) 231 { 232 image = primaryImage.Medium; 233 } 234235 if ( product != null ) 236 { 237 dynamic productData = new 238 { 239 id = product.Id, 240 url = productLink, 241 number = product.Number, 242 name = product.Name, 243 imageDefault = image, 244 price = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice( product.Id ).Format(), 245 priceClean = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice( product.Id ).Price, 246 productIntroText = product.GetCategoryValue( "ProductsGeneral", "ProductIntroText" )?.ToString(), 247 news = product.GetCategoryValue( "ProductsGeneral", "News" )?.ToString(), 248 productType = product.GetCategoryValue( "ProductsGeneral", "ProductType" )?.ToString(), 249 isModelProductList = isModelProductList, 250 productlistDetailImage = detailsImage, 251 shopType 252 }; 253254 <div class="@productlistItemClassList"> 255 <div class="border-1 card mb-6"> 256 <a href="@productData.url"> 257 @if ( productData.isModelProductList == "True" ) 258 { 259 <img src="@productData.productlistDetailImage" alt="@productData.name @productData.productType" class="col-12 p-0"> 260 } 261 else 262 { 263 <img src="@productData.imageDefault" alt="@productData.name @productData.productType" class="col-12 p-0"> 264 } 265 @if ( productData.news == "True" ) 266 { 267 <div class="isabella-product-item-news"> 268 @Dynamicweb.Rendering.Translation.Translation.GetTranslation( "Ecom Product - News Badge - Text" ) 269 </div> 270 } 271 </a> 272 <div class="card-body p-1 p-lg-3"> 273 <h4 class="e-products-item-name mb-0"> 274 <a href="@productData.url"> 275 @productData.name 276 </a> 277 </h4> 278279 </div> 280 </div> 281 </div> 282 } 283 } 284285286 @helper sectionStart(string sectionClasses = "e-section", string contentClasses = null, bool sectionCollapse = false, string sectionId = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null) 287 { 288 sectionId = string.IsNullOrEmpty( sectionId ) ? Guid.NewGuid().ToString( "N" ) : sectionId; 289 ClassList sectionClassList = new ClassList(); 290 sectionClassList.AddClasses( sectionClasses ); 291 ClassList contentClassList; 292293 if ( contentClasses == null ) 294 { 295 contentClassList = Co3.Espresso.Website.Services.PageService.Instance.GetResponsiveClassesFromPageItem( PageView.Current().Page.Item ); 296 } 297 else 298 { 299 contentClassList = new ClassList(); 300 contentClassList.AddClasses( contentClasses ); 301 } 302303 // TODO: Split collapse logic into separate helper function. 304 string collapseId = Guid.NewGuid().ToString( "N" ); 305 ClassList collapseToggleClassList = new ClassList(); 306 if ( sectionCollapse ) 307 { 308 sectionClassList.AddClasses( "p-section-collapse js-p-section-collapse" ); 309 collapseToggleClassList.AddClasses( contentClasses ); 310 collapseToggleClassList.AddClasses( "p-section-collapse-toggle collapsed order-last text-center" ); 311 contentClassList.AddClasses( "p-section-collapse-content collapse is-md" ); 312 } 313314 @:<section class="@sectionClassList" id="@sectionId"> 315 @:<div class="container-fluid"> 316 @:<div class="row"> 317318 // TODO: Split collapse logic into separate helper function. 319 if ( sectionCollapse ) 320 { 321 <div class="@collapseToggleClassList" data-toggle="collapse" data-target="#@collapseId"> 322 <button class="btn btn-primary p-section-collapse-toggle-btn" type="button"> 323 <i class="material-icons p-section-collapse-toggle-icon">keyboard_arrow_down</i> 324 </button> 325 <small class="h4 p-section-collapse-toggle-text" data-expand-text="@( string.IsNullOrEmpty( collapseToggleTextExpand ) ? GetStandardCollapseToggleTextExpand() : collapseToggleTextExpand )" data-collapse-text="@( string.IsNullOrEmpty( collapseToggleTextCollapse ) ? GetStandardCollapseToggleTextCollapse() : collapseToggleTextCollapse )"></small> 326 </div> 327 } 328329 @:<div class="@contentClassList" id="@collapseId"> 330 @:<div class="row"> 331 } 332333 @helper sectionEnd() 334 { 335 @:</div> 336 @:</div> 337 @:</div> 338 @:</div> 339 @:</section> 340 } 341342343344345346 @{ 347 ClassList productlistItemClassList = new ClassList(); 348 Dictionary< string, decimal > paragraphEcommerceGridItemWidth = ProductlistService.Instance.GetGridItemWidth( PageView.Current().CurrentParagraph.Item.GetValue< string >( "ItemWidth" ) ); 349 productlistItemClassList.AddClasses 350 ( paragraphEcommerceGridItemWidth.ToResponsiveClasses 351 () 352 ); 353 } 354355 <div class="e-productlist"> 356357 <div class="row"> 358 <div class="col-12"> 359360 <div class="e-productlist-body"> 361 <div class="row"> 362 <div class="col-12"> 363 <div class="e-products"> 364 <div class="row"> 365 @foreach ( Product product in GetLoop( "Products" ).Select( p => Product.GetProductById( p.GetString( "Ecom:Product.ID" ) ) ) ) 366 { 367 @ProductlistItem( product, productlistItemClassList.ToString(), Espresso.Item.ModelProductlist ) 368 } 369 </div> 370 </div> 371 </div> 372 </div> 373 </div> 374375 </div> 376 </div> 377378 </div>
keyboard_arrow_up