Favorite list updated

Værktøjsliner 4,5 kg lås-til-lås 3M Sala
921500054X
Log ind for at se priser og købe produktet
- Værktøjssikring
- Fast værktøjsline med lås i begge ender
- Pakke med 10 stk
- Værktøjsholder til sikring af værktøj ved arbejde i højden
- Maks. belastning 4,5 kg
- Kan fastgøres direkte på værktøj med huller eller ved brug af et fastgørelsespunkt med egnet belastningsstyrke.
- Det anbefales at værktøj der vejer mere end 2,3 kg kobles til et fast punkt og ikke til brugeren
Error executing template "Designs/Swift/Paragraph/VariantOrderMatrix_Custom.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_1c71abae16ae420e90e583e1d0c10192.Execute() in D:\web\OttoSchachner\Files\Templates\Designs\Swift\Paragraph\VariantOrderMatrix_Custom.cshtml:line 146 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 @using Dynamicweb.Ecommerce.Products 4 @using Dynamicweb.Core 5 @using Dynamicweb.Ecommerce.Common 6 @using System.Web; 7 @using Dynamicweb.Ecommerce.Prices 8 @using System.Web 9 @using Dynamicweb.Security.UserManagement 10 11 @{ 12 bool isVisualEditor = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) ? Convert.ToBoolean(Dynamicweb.Context.Current.Request.QueryString.Get("VisualEdit")) : false; 13 14 ProductViewModel product = new ProductViewModel(); 15 16 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 17 { 18 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 19 } 20 21 Dynamicweb.Ecommerce.Shops.Shop shop = new Dynamicweb.Ecommerce.Shops.ShopService().GetShop(Dynamicweb.Frontend.PageView.Current().Area.EcomShopId); 22 PriceContext priceContext = new PriceContext(Context.Currency, Context.Country, shop, User.GetCurrentExtranetUser(), false, null); 23 24 bool mobile = Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Mobile || Pageview.Device == Dynamicweb.Frontend.Devices.DeviceType.Tablet; 25 var user = User.GetCurrentExtranetUser(); 26 27 bool isLiveIntegrationUserDisabled = Vestjysk.OttoSchachner.CustomCode.Helpers.LiveIntegration.IsLiveIntegrationUserDisabled(); 28 bool hideAddToCart = isLiveIntegrationUserDisabled; 29 30 31 if (!mobile) 32 { 33 ProductService productService = new ProductService(); 34 Product ecomProduct = productService.GetProductById(product.Id, product.VariantId, true); 35 var productFieldStatusMatches = Model.Item.GetString("ProductFieldStatusMatches").ToLower().Split(','); 36 double purchaseQuantityStep = Converter.ToDouble(productService.GetPropertyValue(ecomProduct, "PurchaseQuantityStep")); 37 purchaseQuantityStep = purchaseQuantityStep > 0 ? purchaseQuantityStep : 1; 38 string url = "/Default.aspx?ID=" + (GetPageIdByNavigationTag("CartService")); 39 if (!url.Contains("LayoutTemplate")) 40 { 41 url += url.Contains("?") ? "&LayoutTemplate=Swift_MiniCart.cshtml" : "?LayoutTemplate=Swift_MiniCart.cshtml"; 42 } 43 44 if (!string.IsNullOrEmpty(Model.Item.GetString("Title")) && !Model.Item.GetBoolean("HideTitle")) 45 { 46 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "h3"); 47 48 <h3 class="@titleFontSize text-center mb-3">@Model.Item.GetString("Title")</h3> 49 } 50 51 <form method="post" action="@url"> 52 <div class="variant-matrix-container theme js-variant-matrix"> 53 <div class="top-button-container"> 54 <div class="search-field-container"> 55 <input type="text" class="variant-search-field js-variant-search-field" placeholder="@HttpUtility.HtmlAttributeEncode(Translate("Smartpage:VariantMatrix.SearchFunction", "Søg efter varenr., DB nr., materiale, størrelse mm.."))" /> 56 <div class="search-icon">@RenderSearchIcon()</div> 57 </div> 58 @if (user != null && !hideAddToCart) 59 { 60 <button type="button" onclick="swift.Cart.Update(event)" class="btn btn-primary order-btn js-add-to-cart-button"> 61 <span class="m-1">@Translate("Smartpage:VariantMatrix.AddToCart", "Læg i kurv")</span> @RenderCartIcon() 62 </button> 63 } 64 65 </div> 66 67 <input type="hidden" name="cartcmd" value="addmulti" /> 68 <input type="hidden" name="redirect" value="false" /> 69 <table class="table table-striped variant-matrix js-variant-table"> 70 <tr class="variant-table-header"> 71 <th data-index="0"> 72 @Translate("Smartpage:VariantMatrix.ProductNo", "Varenummer") 73 <span class="sort-triangle asc js-sort-triangle"></span> 74 </th> 75 @{ 76 int index = 1; 77 foreach (var variantGroup in product.VariantGroups()) 78 { 79 <th data-index="@index"> 80 @Translate($"Smartpage:VariantGroup.Name.{variantGroup.Name}", variantGroup.Name) 81 <span class="sort-triangle none js-sort-triangle"></span> 82 </th> 83 index++; 84 } 85 } 86 <th data-index="@(index++)"> 87 @Translate("Smartpage:VariantMatrix.DbNumber", "DB-nummer") 88 <span class="sort-triangle none js-sort-triangle"></span> 89 </th> 90 <th data-index="@(index++)"> 91 @Translate("Smartpage:VariantMatrix.EAN", "EAN/UPC") 92 <span class="sort-triangle none js-sort-triangle"></span> 93 </th> 94 <th data-index="@(index++)"> 95 @Translate("Smartpage:VariantMatrix.SpStatus", "Skaffevare") 96 <span class="sort-triangle none js-sort-triangle"></span> 97 </th> 98 <th data-index="@(index++)"> 99 @Translate("Smartpage:VariantMatrix.OrderQuantity") 100 <span class="sort-triangle none js-sort-triangle"></span> 101 </th> 102 <th data-index="@(index++)"> 103 @Translate("Smartpage:VariantMatrix.Packaging") 104 <span class="sort-triangle none js-sort-triangle"></span> 105 </th> 106 </tr> 107 @{ 108 string languageID = Context.LanguageID; 109 int count = 0; 110 } 111 @foreach (var variantComb in ecomProduct.VariantCombinations) 112 { 113 count++; 114 115 var variantProduct = variantComb.GetProduct(languageID); 116 string dbNumber = variantProduct?.ProductFieldValues?.GetProductFieldValue("SpDBNumber")?.Value?.ToString() ?? string.Empty; 117 dbNumber = !string.IsNullOrEmpty(dbNumber) ? dbNumber : Translate("Smartpage:VariantMatrix.NotAvailable", "N/A"); 118 string EAN = !string.IsNullOrEmpty(variantProduct?.EAN) ? variantProduct.EAN : Translate("Smartpage:VariantMatrix.NotAvailable", "N/A"); 119 var variantFieldStatus = Convert.ToString(variantProduct?.ProductFieldValues?.GetProductFieldValue("SpStatus")?.Value)?.ToLower() ?? string.Empty; 120 var status = productFieldStatusMatches.Contains(variantFieldStatus) ? Translate("Smartpage:VariantMatrix.Status.Yes", "JA") : ""; 121 var packaging = variantProduct?.GetProductFieldValue("SpUnitsConcat").ToString(); 122 string orderQuantity = variantProduct?.PurchaseQuantityStep.ToString(); 123 var unit = variantProduct?.GetProductFieldValue("SpSalesUnit"); 124 125 if (orderQuantity == "0") 126 { 127 orderQuantity = ""; 128 unit = ""; 129 } 130 131 string price = variantProduct?.GetPrice(priceContext).PriceWithoutVATFormatted; 132 string cartUrl = "/Default.aspx?ID=" + (GetPageIdByNavigationTag("CartService")); 133 purchaseQuantityStep = Converter.ToDouble(productService.GetPropertyValue(variantProduct, "PurchaseQuantityStep")); 134 purchaseQuantityStep = purchaseQuantityStep > 0 ? purchaseQuantityStep : 1; 135 136 if (variantProduct != null && variantProduct.Active) 137 { 138 <tr> 139 <input type="hidden" name="ProductLoopCounter@(count)" id="ProductLoopCounter@(count)" value="@count" /> 140 <input type="hidden" name="ProductId@(count)" id="ProductId@(count)" value="@variantProduct.Id" /> 141 <input type="hidden" name="VariantId@(count)" id="VariantId@(count)" value="@variantComb.VariantId" /> 142 143 <td>@variantProduct.Number</td> 144 @foreach (var optionId in variantComb.GetVariantOptionIds()) 145 { 146 <td>@product.VariantGroups().Find(group => group.Options.Find(option => option.Id == optionId) != null).Options.Single(option2 => option2.Id == optionId).Name</td> 147 } 148 <td>@dbNumber</td> 149 <td>@EAN</td> 150 <td>@status</td> 151 <td>@orderQuantity @unit</td> 152 <td>@packaging</td> 153 @if (user != null) 154 { 155 <td class="text-center order-column js-dont-search"> 156 <div class="stock-level"> 157 @RenderPartial("Components/StockLevel_Custom.cshtml", product, new Dictionary<string, object>() { { "product", variantProduct } }) 158 </div> 159 <div class="price-container"> 160 <div class="price-text"> 161 <span class="js-price-brutto">@variantProduct.DefaultPrice kr.</span> 162 <span class="js-price-liveintegration d-none">(@price)</span> 163 </div> 164 <div class="quantity-text">@Translate("Smartpage:VariantMatrix.Quantity", "Bestilles i: ") @purchaseQuantityStep @product.ProductFields["SpSalesUnit"].Value</div> 165 </div> 166 <div class="quantity-selector-container"> 167 <div class="quantity-selector"> 168 <span class="quantity-symbol js-quantity-minus">−</span> 169 <input class="quantity-input js-quantity" name="Quantity@(count)" type="number" step="@purchaseQuantityStep" min="0" value="0"> 170 <span class="quantity-symbol js-quantity-plus">+</span> 171 </div> 172 </div> 173 </td> 174 } 175 176 </tr> 177 } 178 } 179 180 @if (ecomProduct.VariantCombinations.Count <= 0) //if no variants then show the current product in variantmatrix.. 181 { 182 count++; 183 184 185 string dbNumber = ecomProduct.ProductFieldValues.GetProductFieldValue("SpDBNumber").Value.ToString(); 186 dbNumber = !string.IsNullOrEmpty(dbNumber) ? dbNumber : Translate("Smartpage:VariantMatrix.NotAvailable", "N/A"); 187 string EAN = !string.IsNullOrEmpty(ecomProduct.EAN) ? ecomProduct.EAN : Translate("Smartpage:VariantMatrix.NotAvailable", "N/A"); 188 var productFieldStatus = Convert.ToString(ecomProduct.ProductFieldValues.GetProductFieldValue("SpStatus")?.Value).ToLower(); 189 var status = productFieldStatusMatches.Contains(productFieldStatus) ? Translate("Smartpage:VariantMatrix.Status.Yes", "JA") : ""; 190 string price = ecomProduct.GetPrice(priceContext).PriceWithoutVATFormatted; 191 string cartUrl = "/Default.aspx?ID=" + (GetPageIdByNavigationTag("CartService")); 192 string orderQuantity = ecomProduct.PurchaseQuantityStep.ToString(); 193 string packaging = ecomProduct.GetProductFieldValue("SpUnitsConcat").ToString(); 194 var unit = ecomProduct.GetProductFieldValue("SpSalesUnit"); 195 196 if (orderQuantity == "0") 197 { 198 orderQuantity = ""; 199 unit = ""; 200 } 201 202 if (ecomProduct.Active) 203 { 204 <tr> 205 <input type="hidden" name="ProductLoopCounter@(count)" id="ProductLoopCounter@(count)" value="@count" /> 206 <input type="hidden" name="ProductId@(count)" id="ProductId@(count)" value="@ecomProduct.Id" /> 207 208 <td>@ecomProduct.Number</td> 209 <td>@dbNumber</td> 210 <td>@EAN</td> 211 <td>@status</td> 212 <td>@orderQuantity @unit</td> 213 <td>@packaging</td> 214 @if (user != null) 215 { 216 <td class="text-center order-column js-dont-search"> 217 <div class="stock-level"> 218 @RenderPartial("Components/StockLevel_Custom.cshtml", product) 219 </div> 220 <div class="price-container"> 221 <div class="price-text"> 222 <span class="js-price-brutto">@ecomProduct.DefaultPrice kr.</span> 223 <span class="js-price-liveintegration">(@price)</span> 224 </div> 225 <div class="quantity-text">@Translate("Smartpage:VariantMatrix.Quantity", "Bestilles i: ") @purchaseQuantityStep @product.ProductFields["SpSalesUnit"].Value</div> 226 </div> 227 <div class="quantity-selector-container"> 228 <div class="quantity-selector"> 229 <span class="quantity-symbol js-quantity-minus">−</span> 230 <input class="quantity-input js-quantity" name="Quantity@(count)" type="number" step="@purchaseQuantityStep" min="0" value="0"> 231 <span class="quantity-symbol js-quantity-plus">+</span> 232 </div> 233 </div> 234 </td> 235 } 236 237 </tr> 238 } 239 } 240 </table> 241 <div class="top-button-container"> 242 @if (user != null & !hideAddToCart) 243 { 244 <button type="button" onclick="swift.Cart.Update(event)" class="btn btn-primary order-btn js-add-to-cart-button"> 245 <span class="m-1">@Translate("Smartpage:VariantMatrix.AddToCart", "Læg i kurv")</span> @RenderCartIcon() 246 </button> 247 } 248 249 </div> 250 </div> 251 </form> 252 } 253 254 <script> 255 if (document.readyState === 'loading') { // Loading hasn't finished yet 256 document.addEventListener('DOMContentLoaded', () => { 257 window.initVariantMatrix(); 258 }); 259 } else { // `DOMContentLoaded` has already fired 260 window.initVariantMatrix(); 261 } 262 </script> 263 } 264 265 @helper RenderSearchIcon() 266 { 267 <svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" 268 width="30" height="30" 269 viewBox="0 0 30 30" 270 style=" fill:#FFF;"> 271 <path d="M 13 3 C 7.4889971 3 3 7.4889971 3 13 C 3 18.511003 7.4889971 23 13 23 C 15.396508 23 17.597385 22.148986 19.322266 20.736328 L 25.292969 26.707031 A 1.0001 1.0001 0 1 0 26.707031 25.292969 L 20.736328 19.322266 C 22.148986 17.597385 23 15.396508 23 13 C 23 7.4889971 18.511003 3 13 3 z M 13 5 C 17.430123 5 21 8.5698774 21 13 C 21 17.430123 17.430123 21 13 21 C 8.5698774 21 5 17.430123 5 13 C 5 8.5698774 8.5698774 5 13 5 z"></path> 272 </svg> 273 } 274 275 @helper RenderCartIcon() 276 { 277 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shopping-bag"> 278 <path d="M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"></path> 279 <line x1="3" y1="6" x2="21" y2="6"></line> 280 <path d="M16 10a4 4 0 0 1-8 0"></path> 281 </svg> 282 } 283