Karabinhager
Error executing template "Designs/kyner/ecom/productlist/partials/item.cshtml" System.IndexOutOfRangeException: FieldValueFieldCategoryId at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) at System.Data.SqlClient.SqlDataReader.get_Item(String name) at Dynamicweb.Ecommerce.ProductCategoryFieldValueRepository.GetValuesByProductIds(IEnumerable`1 productIds, String defaultLanguageId) at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldValueService.GetValuesByProductIds(List`1 productIds, ProductCategoryFieldValueRepository repository) at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldValueService.FetchMissingValuesInternal(ProductCategoryFieldValueRepository repository, IEnumerable`1 keys, Boolean resetFieldLookup) at Dynamicweb.Caching.ServiceCache`2.GetCache(IEnumerable`1 keys) at Dynamicweb.Caching.ServiceCache`2.GetCache(TKey key) at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldValueService.GetCategoryValue(Product product, String defaultLanguageId, IEnumerable`1 orderedGroups, Field catField, Boolean includeInheritance) at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldValueService.GetCategoryValue(Product product, String categoryId, String fieldId, Boolean includeInheritance) at Dynamicweb.Ecommerce.Products.Product.GetCategoryValue(String categoryId, String fieldId) at Co3.Kyner.Website.Frontend.Models.Ecommerce.KynerProduct.get_UnitsPerColli() in C:\Git\co3.kyner\Co3.Kyner.Website.Frontend\Models\Ecommerce\KynerProduct.cs:line 57 at CompiledRazorTemplates.Dynamic.RazorEngine_2acee611ae0b4f868b3e23648cf850bb.Execute() in E:\Dynamicweb.NET\Solutions\kyner-espresso-4\Files\Templates\Designs\kyner\ecom\productlist\partials\item.cshtml:line 42 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 ViewModelTemplate< Co3.Kyner.Website.Frontend.Models.Ecommerce.KynerProduct > 2 @using Co3.Espresso.Website.Models.FrontEnd.Ecommerce 3 @using Co3.Espresso.Website.Models.FrontEnd.Handlebars 4 @using Co3.Espresso.Website.Services 5 @using Co3.Kyner.Website.Frontend.Services 6 @using Dynamicweb.Frontend 7 @using Dynamicweb.Rendering 8 @using Dynamicweb.Security.UserManagement 9 @using System.Web 10 11 @{ 12 bool isUserAuthenticated = User.IsExtranetUserLoggedIn(); 13 int pageId = PageService.Instance.GetPageIdByPageLink( ( string ) PageView.Current().Area.Item[ "EcommercePage" ] ); 14 15 string groupId = Model.PrimaryOrFirstGroupId; 16 string productRawUrl = string.Empty; 17 if ( string.IsNullOrEmpty( Model.VariantId ) ) 18 { 19 productRawUrl = !string.IsNullOrEmpty( groupId ) ? string.Format( "Default.aspx?ID={0}&GroupID={1}&ProductID={2}", pageId.ToString(), groupId, Model.Id ) : string.Format( "Default.aspx?ID={0}&ProductID={1}", pageId.ToString(), Model.Id ); 20 } 21 else 22 { 23 productRawUrl = !string.IsNullOrEmpty( groupId ) ? string.Format( "Default.aspx?ID={0}&GroupID={1}&ProductID={2}&VariantID={3}", pageId.ToString(), groupId, Model.Id, Model.VariantId ) : string.Format( "Default.aspx?ID={0}&ProductID={1}&VariantID={2}", pageId.ToString(), Model.Id, Model.VariantId ); 24 } 25 string productLink = SearchEngineFriendlyURLs.GetFriendlyUrl( productRawUrl ); 26 } 27 28 <div class="py-2 px-1 bg-white rounded w-100 e-block-link e-productlist-item js-e-block-link js-e-productlist-item js-e-productlist-item-@Model.Id" data-rawurl="@productRawUrl" data-product-id="@Model.Id" data-variant-id="@Model.VariantId"> 29 <div class="e-productlist-item-container"> 30 <div class="e-productlist-item-image-container"> 31 <a class="e-productlist-item-image-wrapper" href="@productLink"> 32 <img alt="@Model.Name" class="e-productlist-item-image" src="@Model.ImagePrimary.Medium"> 33 </a> 34 </div> 35 <div class="e-productlist-item-text-container small text-left"> 36 <h3 class="e-productlist-item-name"> 37 <a href="@productLink">@Model.Name</a> 38 </h3> 39 40 @{ 41 string unitsPerColli = ""; 42 if (Model.UnitsPerColli != null && Model.UnitsPerColli > 0 && isUserAuthenticated) 43 { 44 unitsPerColli = String.Format("<span> | Kolli: {0} stk </span>", Model.UnitsPerColli); 45 } 46 } 47 48 <p class="small colli-info mb-0">Varenr: @Model.Number @unitsPerColli</p> 49 50 51 @if (isUserAuthenticated) 52 { 53 if (Model.Stock != null) 54 { 55 56 if (Model.Stock.Quantity > 0) 57 { 58 <p class="stock-info in-stock mb-0">@Model.Stock.State</p> 59 } 60 else 61 { 62 <p class="stock-info out-of-stock mb-0">@Model.Stock.State</p> 63 } 64 } 65 } 66 @if ( !KynerProductService.Instance.HidePrices() ) { 67 <p class="e-productlist-item-text mb-0 mt-1"> 68 @if (isUserAuthenticated) 69 { 70 <span class="price-number-info d-block mb-0">@Translate("eCom Product - Product Single text - Text", "Pris pr. stk. v. 1 stk")</span> 71 if(Model.RetailPrice.Value > 0) { 72 <span class="e-productlist-item-price d-block mb-1"> 73 <a href="@productLink"> 74 @Model.Price.Formatted 75 </a> 76 </span> 77 <p class="small mb-0 price-number-info d-block ">@Translate("eCom Product - Product SalesPrice text - Text", "Vejledende udsalgspris"):</p> 78 <p class="small mb-1 font-weight-bold">@Model.RetailPrice.Format()</p> 79 } 80 else 81 { 82 <span class="e-productlist-item-price d-block mb-1"> 83 <a href="@productLink"> 84 @Model.Price.Formatted 85 </a> 86 </span> 87 } 88 } 89 else 90 { 91 if (isUserAuthenticated) 92 { 93 <span class="price-number-info d-block mb-0">@Translate("eCom Product - Product SalesPrice text - Text", "Vejledende udsalgspris"):</span> 94 <span class="e-productlist-item-price d-block mb-0"> 95 <a href="@productLink"> 96 @Model.RetailPrice.Format() 97 </a> 98 </span> 99 } 100 } 101102 </p> 103 } 104105 @if(isUserAuthenticated) { 106 if (!KynerProductService.Instance.HidePrices()) 107 { 108 <div class="kyner-custom-products-add-to-cart-wrapper mt-1"> 109 <form action="/system/data/cart" class="e-product-form js-e-product-form" method="post"> 110 <input name="CartCmd" type="hidden" value="Add"> 111 <input type="hidden" name="ProductID" value="@Model.Id"> 112 <input name="VariantID" type="hidden" value=""> 113 <input name="UnitID" type="hidden" value=""> 114 <input name="Redirect" type="hidden" value=""> 115116 <div class="kyner-custom-products-add-to-cart"> 117 <input class="e-product-quantity js-e-product-quantity js-e-product-quantity-@Model.Id" name="Quantity" type="number" value="1" max="{{stock.quantity}}"> 118 <button class="btn btn-secondary">@Translate("eCom Product - Add To Cart - Button", "Add to cart")</button> 119 </div> 120 </form> 121 <span class="d-none js-e-product-quantity-error-msg js-e-product-quantity-error-msg-@Model.Id"></span> 122 </div> 123 } 124 } 125126127 @if (isUserAuthenticated) 128 { 129 @RenderingService.Instance.PartialView("ecom/product/partials/add-to-favorites.cshtml", Model) 130 } 131 </div> 132 </div> 133 </div> 134
Karabinhage 5095 MP 55mm
Varenr: 202285
Alle priser er inkl. VAT