80163

Function Plus desk -

    Error executing template "Designs/tvilum/ecom/product/partials/tvilum-add-to-cart.cshtml"System.ArgumentNullException: Value cannot be null.Parameter name: keyat System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)at System.Collections.Generic.Dictionary`2.get_Item(TKey key)at CompiledRazorTemplates.Dynamic.RazorEngine_828757d305924cb58fdfe864d69db86c.Execute() in E:\Solutions\Tvilum\Files\Templates\Designs\tvilum\ecom\product\partials\tvilum-add-to-cart.cshtml:line 59at 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.b__0(TextWriter writer)at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)at Dynamicweb.Rendering.Template.RenderRazorTemplate()
    1 @inherits ViewModelTemplate< EspressoProduct > 2 @using Co3.Espresso.Base.Extensions 3 @using Co3.Espresso.Website.Models.FrontEnd.Ecommerce 4 @using Co3.Tvilum.Utilities.Extensions 5 @using Co3.Tvilum.Website.Models.Frontend.Ecommerce 6 @using Dynamicweb.Core 7 @using Dynamicweb.Rendering 8 9 @*<form action="/system/data/cart" class="e-product-form tvilum-add-to-cart-form js-e-product-form js-e-product-form-addtocart" method="post"> 10 <input name="CartCmd" type="hidden" value="Add"> 11 <input name="ProductID" type="hidden" value="@Model.Id"> 12 <input name="VariantID" type="hidden" value="@Model.VariantId"> 13 <input name="Redirect" type="hidden" value=""> 14 <input name="Name" type="hidden" value="@Model.Name"> 15 <input name="Number" type="hidden" value="@Model.Number"> 16 <input name="Price" type="hidden" value="@Model.Price.Value.ToJavaScript()"> 17 <input name="CurrencyCode" type="hidden" value="@Model.Price.CurrencyCode"> 18 19 <div class="d-flex"> 20 <div class="js-custom-number-input tvilum-number-input-group input-group"> 21 <div class="input-group-prepend" id="minus-btn"> 22 <span class="input-group-text">-</span> 23 </div> 24 <input name="Quantity" class="form-control" id="qty_input" type="text" value="1" min="1"> 25 <div class="input-group-append" id="plus-btn"> 26 <span class="input-group-text">+</span> 27 </div> 28 </div> 29 <div class="tvilum-add-to-cart-button pl-1"> 30 <button class="btn btn-success" type="submit">@Translate( "eCom Product - Add To Cart - Button", "Add to cart" )</button> 31 </div> 32 </div> 33 34 </form>*@ 35 36 37 38 <form action="/system/data/cart" class="e-product-form js-e-product-form js-e-product-form-addtocart py-1" method="post"> 39 <input name="CartCmd" type="hidden" value="Add"> 40 <input name="ProductID" type="hidden" value="@Model.Id"> 41 <input name="VariantID" type="hidden" value="@Model.VariantId"> 42 <input name="Quantity" type="hidden" value="1"> 43 <input name="Redirect" type="hidden" value=""> 44 <input name="Name" type="hidden" value="@Model.Name"> 45 <input name="Number" type="hidden" value="@Model.Number"> 46 <input name="Price" type="hidden" value="@Model.Price.Value.ToJavaScript()"> 47 <input name="CurrencyCode" type="hidden" value="@Model.Price.CurrencyCode"> 48 49 50 @if ( Model.VariantGroups.Any() ) 51 { 52 @*<div class="border-bottom border-top mb-1 py-1">*@ 53 foreach ( KeyValuePair< string, EspressoVariantGroup > variantGroup in Model.VariantGroups ) 54 { 55 string variantInputFieldId = string.Format( "{0}_{1}", Model.Id, variantGroup.Value.Id ); 56 if ( variantGroup.Value.Id == "Colors" ) 57 { 58 string selectedVariantCombinationKey = variantGroup.Value.SelectedOptionId; 59 EspressoProduct selectedVariantCombination = Model.VariantCombinations[ selectedVariantCombinationKey ]; 60 if ( variantGroup.Value.Options.Count() > 1 ) 61 { 62 <div class="dropdown tvilum-product-variant-dropdown js-tvilum-product-variant-dropdown"> 63 <a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 64 @Translate("eCom Product - Select Another Color - Label", "Vælg anden farve") 65 </a> 66 <div class="dropdown-menu p-0 form-control" aria-labelledby="dropdownMenuLink" data-variant-group-id="@variantGroup.Value.Id" name="@variantGroup.Value.Id" id="@variantInputFieldId"> 67 @foreach ( KeyValuePair<string,string> variantOption in variantGroup.Value.Options ) 68 { 69 TvilumProduct variantCombination = (TvilumProduct) Model.VariantCombinations[ variantOption.Key ]; 70 bool isSelected = variantOption.Key == variantGroup.Value.SelectedOptionId; 71 string disabled = isSelected ? "disabled" : string.Empty; 72 string backgroundImage = string.Empty; 73 if ( variantCombination.ImageDetails.Any() ) 74 { 75 backgroundImage = variantCombination.ImageDetails[ 0 ].AsTvilumProductImageUrl().Xsmall; 76 } 77 78 <label for="@string.Format("{0}-{1}", variantOption.Key, variantGroup.Value.Id)" class="@variantOption.Key @variantGroup.Value.SelectedOptionId border-bottom d-flex py-1 m-0 dropdown-item @disabled" data-after-content="@Translate("eCom Product - Select - Label", "Vælg")"> 79 <input type="radio" @disabled id="@string.Format("{0}-{1}", variantOption.Key, variantGroup.Value.Id)" value="@variantOption.Key" name="@variantGroup.Value.Id" data-variant-group-id="@variantGroup.Value.Id" class="d-none js-e-product-form-variant-group-input required" @( isSelected ? "checked" : string.Empty ) /> 80 <span class="mr-2 thumb" style="background-image: url('@backgroundImage');"></span> 81 <span class="align-self-center"> 82 <span class="d-block text-nowrap">@variantCombination.Name - @variantCombination.TvilumColourNames.Replace(",", " / ")</span> 83 <small class="d-block">@variantCombination.Number</small> 84 </span> 85 </label> 86 } 87 </div> 88 </div> 89 } 90 } 91 else 92 { 93 <div class="form-group"> 94 <label for="@variantInputFieldId" class="font-weight-bold form-control-label">@variantGroup.Value.Name</label> 95 <select class="form-control js-e-product-form-variant-group-input required" data-variant-group-id="@variantGroup.Value.Id" name="@variantGroup.Value.Id" id="@variantInputFieldId"> 96 <option disabled value=""></option> 97 @foreach ( KeyValuePair< string, string > variantOption in variantGroup.Value.Options ) 98 { 99 bool isSelected = variantOption.Key == variantGroup.Value.SelectedOptionId;100 <option value="@variantOption.Key" @( isSelected ? "selected" : string.Empty )>@variantOption.Value</option>101 }102 </select>103104 </div>105 }106107108109110111 }112 @*<button class="btn btn-secondary js-e-variant-button-reset" type="button">@Translate( "eCom Product - Variants Reset - Button", "Reset" )</button>*@113 @* </div>*@114 }115116 @*<button class="btn btn-success" type="submit">@Translate( "eCom Product - Add To Cart - Button", "Add to cart" )</button>*@117 </form>118

    Specifications