Green-Tex® All Purpose Cloth, red, 38 x 38 cm, pack of 20 | Stadsing A/S

Logo
Exception in template (Designs\StandardWebshop\eCom/Product/Product.cshtml): System.Exception: Error Running ExecuteReader: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding., Sql: "SELECT
	                    -- Object columns
	                    O.DefinitionKey
	                    ,O.LastModified AS OjectLastModified
	                    ,O.ObjectId
	                    ,O.XmlObjectId
	                    ,O.ShopId
	                    ,O.LanguageId

	                    -- Value columns
	                    ,V.LastModified AS ValueLastModified
	                    ,V.XmlReferenceObjectId
	                    ,V.XmlReferenceObjectKey
	                    ,V.ValueId
	                    ,V.[Text]
                        ,V.FieldKey
                        ,V.SortOrder

                    FROM [LWI_Spec_Objects] AS O
                    JOIN [LWI_Spec_Values] AS V ON
	                    V.ShopId = O.ShopId
	                    AND V.LanguageId = O.LanguageId
	                    AND V.XmlObjectKey = O.DefinitionKey
	                    AND V.XmlObjectId = O.XmlObjectId
                    WHERE
                        O.DefinitionKey IN ('Product')
                        AND O.XmlObjectId IN ('3123')
                        AND O.ShopId IN ('SHOP1')
                        AND O.LanguageId IN ('LANG2')
                    ORDER BY O.DefinitionKey, O.LanguageId, O.ShopId, O.XmlObjectId
                    ", Params: '' ---> System.Data.SqlClient.SqlException: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out
   --- End of inner exception stack trace ---
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at Glimpse.Ado.AlternateType.GlimpseDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at NLWI.Platforms.Dynamicweb8.Database.ADatabaseRepository.ExecuteReader(String query, Object[] ps) in D:\VSO Agents\00TFS01-norriq-ip\_work\136\s\NLWI.Platforms.Dynamicweb8\Database\ADatabaseRepository.cs:line 106
   --- End of inner exception stack trace ---
   at NLWI.Platforms.Dynamicweb8.Database.ADatabaseRepository.ExecuteReader(String query, Object[] ps) in D:\VSO Agents\00TFS01-norriq-ip\_work\136\s\NLWI.Platforms.Dynamicweb8\Database\ADatabaseRepository.cs:line 113
   at NLWI.Platforms.Dynamicweb8.Specs.Repositories.SpecificationRepository.GetSpecificationObjects(HashSet`1 keys) in D:\VSO Agents\00TFS01-norriq-ip\_work\134\s\NLWI.Platforms.Dynamicweb8.Specs\Repositories\SpecificationRepository.cs:line 261
   at NLWI.Platforms.Dynamicweb8.Specs.Services.CachedSpecificationService.b__12_1(HashSet`1 k) in D:\VSO Agents\00TFS01-norriq-ip\_work\134\s\NLWI.Platforms.Dynamicweb8.Specs\Services\CachedSpecificationService.cs:line 91
   at NLWI.Core.Platform.Caching.DictionaryCaching.GetOrInsert[TKey,TVal](HashSet`1 keys, Func`2 buildCacheKey, Func`2 lookupMethod, CacheOptions cacheOptions) in D:\VSO Agents\00TFS01-norriq-ip\_work\35\s\src\NLWI.Core\Platform\Caching\DictionaryCaching.cs:line 102
   at NLWI.Platforms.Dynamicweb8.Specs.Services.CachedSpecificationService.GetSpecificationObjects(HashSet`1 specificationObjectIdentifiers) in D:\VSO Agents\00TFS01-norriq-ip\_work\134\s\NLWI.Platforms.Dynamicweb8.Specs\Services\CachedSpecificationService.cs:line 88
   at NLWI.Platforms.Dynamicweb8.Specs.Services.CachedProductSpecificationService.GetProductSpecifications(HashSet`1 productAutoIds) in D:\VSO Agents\00TFS01-norriq-ip\_work\134\s\NLWI.Platforms.Dynamicweb8.Specs\Services\CachedProductSpecificationService.cs:line 56
   at NLWI.Platforms.Dynamicweb8.Specs.Services.CachedProductSpecificationService.GetProductSpecifications(Int64 productAutoId) in D:\VSO Agents\00TFS01-norriq-ip\_work\134\s\NLWI.Platforms.Dynamicweb8.Specs\Services\CachedProductSpecificationService.cs:line 83
   at NLWI.Platforms.Dynamicweb8.Specs.ProductSpecificationExtensionMethods.GetProductSpecifications(Int32 autoId) in D:\VSO Agents\00TFS01-norriq-ip\_work\134\s\NLWI.Platforms.Dynamicweb8.Specs\ProductSpecificationExtensionMethods.cs:line 48
   at NLWI.Platforms.Dynamicweb8.Specs.ProductSpecificationExtensionMethods.GetProductSpecifications[T](RazorTemplateBase`1 page) in D:\VSO Agents\00TFS01-norriq-ip\_work\134\s\NLWI.Platforms.Dynamicweb8.Specs\ProductSpecificationExtensionMethods.cs:line 24
   at CompiledRazorTemplates.Dynamic.abdbcaccbcfaa.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output() in E:\Program Files (x86)\Jenkins\jobs\Release DW881\workspace\Dynamicweb\Rendering\Template.vb:line 777
@using System.Web @using NORRIQ.Universal.Extensions @using NORRIQ.Common8.Context @using System.Web.Mvc.Html @using Dynamicweb.NewsLetterV3 @using Newtonsoft.Json @using NORRIQ.Common8.Ecom @using NORRIQ.Common8.Factory @using NORRIQ.FavoriteList.Models @using NORRIQ.FavoriteList.Services @using StandardWebshop.CustomCode.Razor @using NORRIQ.Common8.Razor; @using Dynamicweb.eCommerce.Common; @using NLWI.Platforms.Dynamicweb8.Specs; @using StandardWebshop.CustomCode.Volumenpriser; @using StandardWebshop.CustomCode.ProductFees; @using StandardWebshop.CustomCode.SupplementalUnit @using StandardWebshop.CustomCode.ColorLookup @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ // EcomMedia settings var image = NORRIQ.EcomMedia.Frontend.GetProductMedia(this); var docs = NORRIQ.EcomMedia.Frontend.GetProductMedia(this); //XPI var specs = this.GetProductSpecifications(); var SpecImages = specs.GetAllByKey("Image"); var SpecVideos = specs.GetAllByKey("YouTubeLinks"); // Product var ProductCurrency = Context.Currency.Symbol; var Productsheet = Translate("Productsheet", "Datablad"); //var AsyncKey = Pageview.User.LoggedIn ? this.GetJsonPriceKey() : ""; //var AsyncPrices = Pageview.User.LoggedIn ? this.GetJsonRetailPrice() : ""; //var ProductInfo = Pageview.User.LoggedIn || //var ShortDescription = GetString("Ecom:Product.LongDescription").Substring(0, 300) + "..."; //var ProductArea = GetGlobalValue("Global:Area.Lang"); var pricePForGoogle = GetString("NIQ:PriceForGoogle"); // Related products var Columns = "col-xs-12 col-sm-4 col-md-4"; var ListMode = ObjectFactory.GetInstance<AreaItemSettings>().GetCurrentAreaValue<string>("ShowRelateproductsAsSlider"); // List mode var mode = ObjectFactory.GetInstance<TemporarilySettings>().GetAndUpdate("listmode") ?? "" + ObjectFactory.GetInstance<AreaItemSettings>().GetCurrentAreaValue<string>("ProductlistMode") + ""; //Favortites var ProductAvailableFavoriteLists = (List<NORRIQ.FavoriteList.Models.FavoriteItemList>)GetValue("NIQ:FavoriteListsAvailable"); var ProductFavoriteListsWithProduct = (List<NORRIQ.FavoriteList.Models.FavoriteItemList>)GetValue("NIQ:FavoritListsWithProduct"); var ProductIsFavorite = ProductFavoriteListsWithProduct.Any(); var ProductListId = ProductAvailableFavoriteLists.Any() ? ProductAvailableFavoriteLists.First().Id : 0; var ProductFavoriteTitle = Translate("button_add_to_favorites", "Marker som favorit \n - du finder alle dine favoritter \n under Din konto"); var volumenpriser = this.GetVolumenpriser(); var productFees = this.GetProductFees(); // Units var defaultUnitId = GetString("Ecom:Product.DefaultUnitID"); var units = GetLoop("Units").Select(u => new { UnitId = u.GetString("Ecom:VariantOption.ID"), // Change the number format here: UnitPrice = (u.GetDouble("Ecom:VariantOption.Price.PricePIP") / 100).ToString("N"), UnitName = u.GetString("Ecom:VariantOption.Name"), UnitCurrencyCode = u.GetString("Ecom:VariantOption.Price.Currency.Code"), Stock = u.GetDouble("Ecom:VariantOption.Stock") }); var unitService2 = ObjectFactory.GetInstance<SupplementalUnitService>(); var packingSpec = specs.GetByGroup("Specifikationer").FirstOrDefault(x => x.Key == "Pakning"); var isTilbud = GetBoolean("Ecom:Product:Field.Tilbud.Value"); } <section class="col-xs-12" itemscope itemtype="http://schema.org/Product"> <div class="row"> <div class="col-xs-12 col-sm-6 product-media"> @if (isTilbud) { <div class="tilbud"><span>@Translate("Tilbud")</span></div> } @if (specs.GetAllByKey("Image").Any()) { <text> @if (SpecImages.Any()) { <div class="product-images" id="product-images"> @foreach (var images in SpecImages) { <a class="product-image mfp-image" data-image-type="image" href="/Admin/Public/GetImage.ashx?Width=1000&amp;Height=1000&amp;Crop=5&amp;Compression=80&amp;Image=/Files/Images/XPI/@(images.Value)"> <img itemprop="image" class="img-responsive" src="/Admin/Public/GetImage.ashx?Width=400&amp;Height=400&amp;Crop=5&amp;Compression=80&amp;Image=/Files/Images/XPI/@(images.Value)" alt="@GetString("Ecom:Product.Name")" /> </a> } @foreach (var video in SpecVideos) { <a class="product-image mfp-iframe" data-image-type="video" href="http://www.youtube.com/watch?v=@(video.Value)?rel=0&autoplay=1"> <img itemprop="image" width="400" class="img-responsive" src="http://img.youtube.com/vi/@(video.Value)/0.jpg" /> </a> } </div> if (SpecImages.Count() > 1 || SpecImages.Any() && SpecVideos.Any()) { <div id="product-images-thumbs" class="product-thumbs"> @foreach (var images in SpecImages) { <div class="product-thumb"> <div class="product-thumb-inner" data-thumb-type="image"> <img class="img-responsive" src="/Admin/Public/GetImage.ashx?Width=110&amp;Height=110&amp;Crop=5&amp;Compression=80&amp;Image=/Files/Images/XPI/@(images.Value)" alt="@GetString("Ecom:Product.Name")" /> </div> </div> } @foreach (var video in SpecVideos) { <div class="product-thumb"> <div class="product-thumb-inner" data-thumb-type="video"> <img class="img-responsive" src="http://img.youtube.com/vi/@(video.Value)/1.jpg" alt="@GetString("Ecom:Product.Name")" /> </div> </div> } </div> } } else { <div class="product-images"> <div class="product-image"> <div class="product-image-inner"> <img class="img-responsive" src="/Admin/Public/GetImage.ashx?&amp;Width=400&amp;Height=400&amp;Crop=5&amp;Compression=80&amp;Image=/Files/Images/Ecom/default.png" alt="@Translate("No image","No image")" /> </div> </div> </div> }</text> } else { <text>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @if (image.GetImages().Any()) { <div class="product-images" id="product-images"> @if (image.GetImages().Any()) { foreach (var images in image.GetImages()) { <a class="product-image mfp-zoom" href="/Admin/Public/GetImage.ashx?Width=1000&amp;Height=1000&amp;Crop=5&amp;Compression=80&amp;Image=@(images.Url)"> <img itemprop="image" class="img-responsive" src="/Admin/Public/GetImage.ashx?Width=400&amp;Height=400&amp;Crop=5&amp;Compression=80&amp;Image=@(images.Url)" alt="@GetString("Ecom:Product.Name")" /> </a> } } @if (!String.IsNullOrEmpty(GetString("Ecom:Product:Field.YoutubeVideoID"))) { var YoutubeSrc = "https://www.youtube-nocookie.com/embed/" + GetString("Ecom:Product:Field.YoutubeVideoID") + "?rel=0"; <div class="product-image"> <iframe src="@YoutubeSrc" width="640" height="360" frameborder="0" allowfullscreen></iframe> </div> } @if (!String.IsNullOrEmpty(GetString("Ecom:Product:Field.VimeoVideoID"))) { var VimeoSrc = "https://player.vimeo.com/video/" + GetString("Ecom:Product:Field.VimeoVideoID") + "?byline=0"; <div class="product-image"> <iframe src="@VimeoSrc" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> </div> } </div> <div id="product-images-thumbs" class="product-thumbs"> @if (image.GetImages().Count() > 1 || image.GetImages().Any() && !String.IsNullOrEmpty(GetString("Ecom:Product:Field.YoutubeVideoID")) || !String.IsNullOrEmpty(GetString("Ecom:Product:Field.VimeoVideoID"))) { foreach (var images in image.GetImages()) { <div class="product-thumb"> <div class="product-thumb-inner" data-thumb-type="image"> <img class="img-responsive" src="/Admin/Public/GetImage.ashx?Width=110&amp;Height=110&amp;Crop=5&amp;Compression=80&amp;Image=@(images.Url)" alt="@GetString("Ecom:Product.Name")" /> </div> </div> } } @if (!String.IsNullOrEmpty(GetString("Ecom:Product:Field.YoutubeVideoID"))) { <div class="product-thumb"> <div class="product-thumb-inner" data-thumb-type="video"> <span class="product-thumb-play"><i class="icon-youtube icon-5x" aria-hidden="true"></i></span> </div> </div> } @if (!String.IsNullOrEmpty(GetString("Ecom:Product:Field.VimeoVideoID"))) { <div class="product-thumb"> <div class="product-thumb-inner" data-thumb-type="video"> <span class="product-thumb-play"><i class="icon-vimeo icon-5x" aria-hidden="true"></i></span> </div> </div> } </div> } else { <div class="product-images"> <div class="product-image"> <div class="product-image-inner"> <img class="img-responsive" src="/Admin/Public/GetImage.ashx?Image=@(image.GetFirstImage().Url)&amp;Width=400&amp;Height=400&amp;Crop=5&amp;Compression=80" /> </div> </div> </div> }</text> } </div> <div class="col-xs-12 col-sm-6 product-data"> @if (specs.GetByKey("BrandSymbol") != null) { var brandSymbol = specs.GetByKey("BrandSymbol"); <div class="brand-logo"> <img src="/Admin/Public/GetImage.ashx?Width=225&amp;Height=60&amp;Compression=80&amp;Crop=5&amp;Image=/Files/Images/XPI/@brandSymbol.Value" alt="@brandSymbol.Value" class="img-responsive" /> </div> } <h1 itemprop="name" class="title-styled"> @GetString("Ecom:Product.Name") </h1> <p class="print text-right"> <span class="product-id pull-left"> <i class="pe-is-ec-label-3-f pe-va"></i> @Translate("Product Number", "Product Number"): <span class="value" itemprop="sku"> @GetString("Ecom:Product.Number") </span> </span> @* Fix this href so it uses the NORRIQ.SEO URL "NIQ:ProductUrl" *@ <a class="hidden-print" rel="nofollow" href="@Navigation.GetUrlByNavigationTag("productsheet")?ProductID=@GetString("Ecom:Product.ID")&amp;VariantID=@GetString("Ecom:Product.VariantID")&amp;PDF=true&amp;Filename=@GetString("Ecom:Product.Name")_@(GetString("Ecom:Product.Number")).pdf"><i class="pe-is-hs-printer-f" aria-hidden="true"></i> @Translate("Print PDF", "Print PDF")</a> </p> <div class="product-price text-right" itemprop="offers" itemscope="" itemtype="http://schema.org/Offer"> @* Prices *@ @if (Pageview.User.LoggedIn) { <p class="product-price-in"> <span class="product-price-price"> @foreach (var unit in units) { <span class="async-price" data-product-key='@(this.GetJsonPriceKey(unit.UnitId))' data-price-mode="details" data-product-retail-price='@(this.GetJsonRetailPrice(unit.UnitId))'> <span class="async-price-total" itemprop="price" content="@pricePForGoogle"> <i class="icon-async icon-pulse"></i> </span> <span class="product-price-label"><span itemprop="priceCurrency" content="@ProductCurrency">@unit.UnitCurrencyCode</span> / @unit.UnitName</span> <br /> </span> } </span> </p> } else { <p class="product-price-in"> <span class="product-price-price"> @foreach (var unit in units) { <span><span itemprop="price" content="@pricePForGoogle">@unit.UnitPrice</span> <span class="product-price-label"><span itemprop="priceCurrency" content="@ProductCurrency">@unit.UnitCurrencyCode</span> / @unit.UnitName</span> <br /></span> } </span> </p> } <p class="product-price-sub"> @* Hide retail price if anonymous user since they are always showed retail prices. *@ @if (Pageview.User.LoggedIn) { <span class="product-vatinfo"> @Translate("Retail-Price", "Retail price:") @GetString("Ecom:Product.Price.PriceWithoutVAT") @ProductCurrency </span> } </p> <div class="row volume-prices-packaging-container"> <div class="col-sm-5 product-packaging-data"> <h3 class="text-left">@Translate("Packaging", "Forpakning")</h3> @if (packingSpec != null) { <div class="packing"> <table class="table table-condensed no-margin"> <tr> <td class="text-left">@packingSpec.Caption</td> <td class="text-right">@packingSpec.Value</td> </tr> </table> </div> } <div class="packaging"> <table class="table table-condensed no-margin"> <tr> <th class="text-left">@Translate("Product pakning", "Pakning")</th> <th class="text-right">@Translate("Product indhold", "Indhold")</th> </tr> @foreach (var unit in unitService2.GetSupplementalUnitByProduct(GetString("Ecom:Product.ID"))) { <tr> <td class="text-left">1 @unit.UnitName</td> <td class="text-right">@unit.QtyInBaseUnitOfMeasure @unit.Bom</td> </tr> } </table> </div> </div> @* Volume prices *@ @if (volumenpriser.HasPrices() && volumenpriser.IsValid()) { <div class="col-sm-offset-1 col-sm-6 volume-prices text-left"> <h3>@Translate("Volume prices", "Volume prices")</h3> <div class="table-responsive async-price" data-product-key='@(this.GetJsonPriceKey())' data-product-retail-price='@(this.GetJsonRetailPrice())'> <table class="table table-block table-striped table-bordered async-price-volumenpriser"> <thead> <tr> <th>@Translate("Volume quantity", "Quantity") @(!Pageview.User.LoggedIn ? "" : "<i class='icon-async icon-pulse'></i> " + Translate("Volume_getting_price", "Fetching Your prices"))</th> <th class="text-right">@Translate("Volume pricePer", "Price per") (@volumenpriser.BaseUnit)</th> </tr> </thead> <tbody> @foreach (var volumenpris in volumenpriser.Priser) { <tr> @if (volumenpris.TranslatedUnitCaption == volumenpriser.BaseUnit) { <td>@volumenpris.MinimumQuantity @volumenpris.TranslatedUnitCaption</td> } else { <td>@volumenpris.MinimumQuantity @volumenpris.TranslatedUnitCaption (@volumenpris.MinimumQuantityInBaseUnit @volumenpriser.BaseUnit)</td> } <td class="text-right">@volumenpris.GetConvertedBOMPrice().ToString("N") @volumenpris.ConvertToCurrencyCode</td> </tr> } </tbody> </table> </div> </div> } </div> @* Product Fees *@ @* Ifølge Emnelog ID 39 er der kun gebyrer på den danske shop. *@ @if (Dynamicweb.Frontend.PageView.Current().AreaID == 1 && productFees.HasFees() && productFees.IsValid()) { @* Parent skal have JS klasse, child bliver vist/skjuld baseret på data-fee-unit-key attribute *@ <div class="text-right"> <ul class="list-unstyled js-fee-container"> @foreach (var fee in productFees.Fees) { var skipFee = !units.Select(u => u.UnitId).Contains(fee.UnitCode); if (skipFee) { continue; } var unit = units.FirstOrDefault(u => string.Equals(u.UnitId, fee.UnitCode)); var unitLabel = unit != null ? unit.UnitName : fee.UnitCode; <li data-fee-unit-key="@fee.UnitCode">@fee.Description @fee.GetConvertedFeePrice().ToString("N") @fee.GetDisplayCurrency() / @unitLabel</li> } </ul> </div> } </div> <div class="product-info hidden-print"> <form class="form-horizontal form-product clearfix" id="prodform_@GetString("Ecom:Product:Page.ID")" name="prodform_@GetString("Ecom:Product:Page.ID")" method="post" action="@GetGlobalValue("Global:Pageview.Url.Raw")"> @* Because of DW and their use of Default units, we have to do this the manual way: http://doc.dynamicweb.com/documentation-8/ecommerce/product-catalog/products#sideNavTitle1-2-5-4 The ones commented out has been deemed not necessary. *@ @*@GetString("Ecom:Product.Form.Clean")*@ @*<input type="hidden" name="ProductURL" id="ProductURL" value="" />*@ <input type="hidden" name="CartCmd" id="CartCmd" value="add" /> <input type="hidden" name="ProductID" id="ProductID" value="@(GetString("Ecom:Product.ID"))" /> <input type="hidden" name="VariantID" id="VariantID" value="" /> @*<input type="hidden" name="UnitID" id="UnitID" value="STK" />*@ @*<input type="hidden" name="wishListID" id="wishListID" value="0" />*@ <label for="quantity" class="sr-only">@Translate("Qty", "Qty")</label> <div class="form-group"> <div class="col-sm-4"> <div class="input-group"> <div class="input-group-addon"> @Translate("Product antal", "Antal") </div> <input name="quantity" id="quantity" value="1" min="1" type="number" class="form-control form-control-qty text-center" autocomplete="off" /> </div> </div> <div class="col-sm-4"> <select name="UnitId" id="unitIdSelector" class="form-control form-unit unit-input JS-ASYNC-UNITSELECTOR JS-ASYNC-INPUT-VALUE" @(units.Count() <= 1 ? "readonly" : "")> @foreach (var unit in units) { <option value="@unit.UnitId" @(String.Equals(unit.UnitId, defaultUnitId) ? "selected" : "")>@unit.UnitName</option> } </select> </div> <div class="col-sm-4"> <div class="product-button"> <button class="btn btn-primary btn-block" role="button" type="submit"> <span class="product-added-text">@Translate("Add to cart", "Add to cart")</span> </button> </div> </div> </div> </form> <div class="row"> @* Stocks *@ @* Stocks bliver hele tiden opdateret via asynkrone kald pga. at units og produktliste bliver loadet, derfor behøver vi ikke dette til at vise rigtig stocks. *@ @if (Pageview.User.LoggedIn) { <div class="col-xs-6 async-price" data-product-key='@(this.GetJsonPriceKey())' data-product-retail-price='@(this.GetJsonRetailPrice())'> <span class="async-price-stock"> <i class="icon-async icon-pulse"></i> </span> </div> } else { <div class="col-xs-6"> @{ var stock = GetDouble("Ecom:Product.Stock"); var isStykliste = GetBoolean("Ecom:Product:Field.Stykliste.Value"); } @if (stock < 1 && !isStykliste) { <i class="icon-stock icon-yellow" title="@Translate("label_in_stock_in_x_days", "Forventes på lager indenfor 4 dage.")"></i> <span class="stock-label-text">@Translate("label_in_stock_in_x_days", "Forventes på lager indenfor 4 dage.")</span> } else { <i class="icon-stock icon-green" title="@stock"></i> <span class="stock-label-text">@Translate("label_in_stock", "In stock")</span> } </div> } @* Favoritelist *@ @if (Pageview.User.LoggedIn) { <div class="col-xs-6 text-right hidden-print"> <a href="javascript:void(0)" class="js-favorite-toggle product-favorite" )" data-favorite-list-id="@ProductListId" data-is-favorite="@(ProductIsFavorite ? "true" : "false")" data-product-id="@(GetString("Ecom:Product.ID"))" data-product-language-id="@(GetString("Ecom:Product.LanguageID"))" data-product-variant-id="@(GetString("Ecom:Product.VariantID"))"> @if (ProductIsFavorite) { <i class="icon-favorite-added"></i> @Translate("label_remove_favorite", "Fjern som favorit") } else { <i class="icon-favorite"></i> @Translate("label_make_favorite", "Marker som favorit") } </a> </div> } </div> </div> @using NLWI.Platforms.Dynamicweb8.Specs; @using StandardWebshop.CustomCode.Razor @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ //var specs = this.GetProductSpecifications(); var showDescription = !String.IsNullOrWhiteSpace(GetString("Ecom:Product.LongDescription")) || !String.IsNullOrEmpty(specs.GetByKey("Produktbeskrivelse").Value); var showTabs = showDescription || specs.GetByGroup("Specifikationer").Any() || specs.GetAllByKey("Datablade").Any(); var colorLookupService = ObjectFactory.GetInstance<ColorLookupService>(); } @if (showTabs) { <ul class="nav nav-tabs product-nav-tabs" role="tablist"> @if (showDescription) { <li role="presentation" class="active"> <a href="#desc" aria-controls="desc" role="tab" data-toggle="tab"> @Translate("Description", "Description") </a> </li> } @if (specs.GetByGroup("Specifikationer").Any()) { <li role="presentation" class="@(!showDescription ? "active": "")"> <a href="#specs" aria-controls="specs" role="tab" data-toggle="tab"> @Translate("Specifications", "Specifications") </a> </li> } @if (specs.GetAllByKey("Datablade").Any()) { <li role="presentation" class="@(!showDescription && !specs.GetByGroup("Specifikationer").Any() ? "active": "")"> <a href="#docs" aria-controls="docs" role="tab" data-toggle="tab"> @Translate("Documents", "Documents") </a> </li> } </ul> <div class="tab-content product-tab-content"> @if (showDescription) { <div role="tabpanel" class="tab-pane active" id="desc" itemprop="description"> @specs.GetByKey("Produktbeskrivelse").Value </div> } @if (specs.GetByGroup("Specifikationer").Any()) { <div role="tabpanel" class="tab-pane @(!showDescription ? "active": "")" id="specs"> <table class="table table-striped"> <tbody> @foreach (var spec in specs.GetByGroup("Specifikationer").GroupBy(a => a.Key)) { if (spec.Key == "BrandSymbol") { continue; } <tr> <td> @spec.First().Caption </td> <td> @if (spec.Key == "Maerkning" || spec.Key == "Vaskeanvisninger") { foreach (var maerkeSpec in spec) { if (spec.Key == "Maerkning") { <img src="/Admin/Public/GetImage.ashx?Width=125&amp;Height=125&amp;Compression=80&amp;Image=/Files/Images/Symbol/@maerkeSpec.Value" alt="@maerkeSpec.Value" class="img-responsive" /> } else if (spec.Key == "Vaskeanvisninger") { <img src="/Admin/Public/GetImage.ashx?Width=46&amp;Height=30&amp;Compression=80&amp;Image=/Files/Images/Symbol/@maerkeSpec.Value" alt="@maerkeSpec.Value" class="img-responsive" /> } } } else if (spec.Key == "Farve") { var colors = spec.Select(a => colorLookupService.GetColorKey(a.Value)); if (colors != null) { foreach (string color in colors) { <span class="spec-color spec-color-@color"></span> } } @*<span> @String.Join(", ", spec.Select(a => a.Value)) </span>*@ } else if (spec.Any(s => SpecificationHelper.IsImageFile(s.Value))) { foreach (var s in spec) { if (SpecificationHelper.IsImageFile(s.Value)) { <img src="/Admin/Public/GetImage.ashx?Width=60&amp;Height=60&amp;Compression=80&amp;Crop=5&amp;Image=/Files/Images/XPI/@s.Value" alt="@s.Value" class="img-responsive" /> } else { @s.Value } } } else { @String.Join(", ", spec.Select(a => a.Value)) } </td> </tr> } </tbody> </table> </div> } @if (specs.GetAllByKey("Datablade").Any()) { <div role="tabpanel" class="tab-pane @(!showDescription && !specs.GetByGroup("Specifikationer").Any() ? "active": "")" id="docs"> <ul class="list-unstyled"> @foreach (var specFile in specs.GetAllByKey("Datablade")) { var originalFilename = specFile.GetReferenceSpecification().GetByKey("Filename").Value; <li> <a download="@originalFilename" href="/Files/XPI-Files/@(specFile.Value)" title="@originalFilename"> @Productsheet </a> </li> } </ul> </div> } </div> } </div> <div class="col-xs-12 product-related hidden-print"> @using System.Globalization @using System.Web.Mvc.Html @using Dynamicweb.NewsLetterV3 @using NORRIQ.EcomMedia @using NORRIQ.FavoriteList.Models @using StandardWebshop.CustomCode.Razor @using NORRIQ.Common8.Razor; @using NORRIQ.Common8.Factory @using Dynamicweb.eCommerce.Common; @using StandardWebshop.CustomCode.ViewModels.Variants; @using NLWI.Platforms.Dynamicweb8.Specs @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ var addToCartMode = ObjectFactory.GetInstance<NORRIQ.Common8.Context.AreaItemSettings>().GetCurrentAreaValue<string>("AddToCartMode"); } @if (GetLoop("ProductRelatedGroups").Any()) { foreach (var grp in GetLoop("ProductRelatedGroups")) { if (grp.GetString("Ecom:Product:RelatedGroup.GroupID").Equals("RELGRP2")) { <h2 class="title-styled"> @grp.GetString("Ecom:Product:RelatedGroup.Name") </h2> <table class="table table-striped table-block productlist-table js-product-table"> <thead> <tr> <th></th> <th class="productlist-table-product"> @*@Translate("Product", "Product")*@ </th> <th></th> <th></th> <th class="productlist-table-number" nowrap> @Translate("Product Number", "Product Number") </th> <th class="productlist-table-stock" nowrap> @Translate("Stock", "Stock") </th> <th class="productlist-table-favorite"> <i class="icon-favorite-added" aria-hidden="true"></i><span class="sr-only">@Translate("Favorite", "Favorite")</span> </th> <th class="productlist-table-price"> @Translate("Price", "Price") </th> <th class="productlist-table-unit"> @Translate("Unit", "Unit") </th> <th class="productlist-table-quantity"> @Translate("Quantity", "Quantity") </th> </tr> </thead> <tbody> @foreach (var product in grp.GetLoop("RelatedProducts")) { var productID = product.GetString("Ecom:Product.Number"); var LoopCounter = product.GetInteger("Ecom:Product.LoopCounter") - 1; var media = NORRIQ.EcomMedia.Frontend.GetProductMedia(product); var link = product.GetString("NIQ:ProductUrl"); var area = GetGlobalValue("Global:Area.Lang"); var availableFavoriteLists = (List<NORRIQ.FavoriteList.Models.FavoriteItemList>)product.GetValue("NIQ:FavoriteListsAvailable"); var favoriteListsWithProduct = (List<NORRIQ.FavoriteList.Models.FavoriteItemList>)product.GetValue("NIQ:FavoritListsWithProduct"); var isFavorite = favoriteListsWithProduct.Any(); var listId = availableFavoriteLists.Any() ? availableFavoriteLists.First().Id : 0; var ProductSpecs = product.GetProductSpecifications(); var image1 = ProductSpecs.GetAllByKey("Image").Any() ? "/Files/Images/XPI/" + ProductSpecs.GetByKey("Image").Value : media.GetFirstImage().Url; var variants = product.GetLoop("VariantGroups").GetVariants(); // In IBH, the Product Number can be used as a unique product identifier. var currentProductNumber = product.GetString("Ecom:Product.Number"); // All variant products and their associated variant groups/options. var variantProducts = product.GetLoop("VariantCombinations").GetVariantProducts(variants, currentProductNumber); var productsDictionary = VariantViewModelBuilder.GetProductsInDimensionOrder(variants, variantProducts); var selectedVariant = VariantViewModelBuilder.GetSelectedOrEmpty(variantProducts); var productSpecGroup = ProductSpecs.GetByGroup("Specifikationer"); IEnumerable<string> filterSizeKeys = new List<string> { "specs_Handskestorrelse", "specs_Toejstoerrelse", "specs_Skostoerrelse", "specs_Stoerrelse" }; //remove prefix "specs_" filterSizeKeys = filterSizeKeys.Select(s => s.Replace("specs_", "")); var sizeObj = productSpecGroup.FirstOrDefault(x => filterSizeKeys.Any(s => s.Equals(x.Key)) && !string.IsNullOrEmpty(x.Value)); var colorList = productSpecGroup.Where(x => x.Key.Equals("Farve") && !string.IsNullOrEmpty(x.Value)); var defaultUnitId1 = product.GetString("Ecom:Product.DefaultUnitID"); var units1 = product.GetLoop("Units").Select(u => new { UnitId = u.GetString("Ecom:VariantOption.ID"), // Change the number format here: UnitPrice = (u.GetDouble("Ecom:VariantOption.Price.PricePIP") / 100).ToString("N"), UnitName = u.GetString("Ecom:VariantOption.Name"), UnitCurrencyCode = u.GetString("Ecom:VariantOption.Price.Currency.Code"), Stock = u.GetDouble("Ecom:VariantOption.Stock") }); @* These lines are required because lazy load's its data. product.GetString("Ecom:VariantGroup.Label") product.GetString("Ecom:VariantGroup.Name") product.GetLoop("VariantAvailableOptions") product.GetString("Ecom:VariantOption.ID") product.GetString("Ecom:VariantOption.Name") *@ <tr itemscope="" itemtype="http://schema.org/Product" class="async-price js-favProduct" data-product-key='@(product.GetJsonPriceKey())' data-product-retail-price='@(product.GetJsonRetailPrice())'> <td class="productlist-table-thumbnail"> <div class="image-wrapper"> <img itemprop="image" class="img-responsive" src="/Admin/Public/GetImage.ashx?Width=400&amp;Height=400&amp;Crop=5&amp;Compression=80&amp;Image=@image1" /> </div> </td> <td class="productlist-table-product"> <a href="@link" tabindex="0" class="productlist-table-name" itemprop="name"> @product.GetString("Ecom:Product.Name") </a> </td> <td class="productlist-table-size"> <span>@(sizeObj != null ? sizeObj.Value : string.Empty)</span> </td> <td class="productlist-table-variant"> @if (colorList.Any()) { foreach (var colorObj in colorList) { var color = colorLookupService.GetColorKey(colorObj.Value); <span class="spec-color spec-color-@color"></span> } } </td> <td class="productlist-table-number" itemid="sku" data-label="@Translate("Product No", "Product No")" nowrap> @product.GetString("Ecom:Product.Number") </td> <td class="productlist-table-stock async-price-stock" data-label="@Translate("Stock", "Stock")" nowrap> @if (Pageview.User.LoggedIn) { <i class="icon-async icon-pulse"></i> } else { var stock = product.GetDouble("Ecom:Product.Stock"); if (stock < 1) { <i class="icon-stock icon-yellow" title="@Translate("label_in_stock_in_x_days", "Forventes på lager indenfor 4 dage.")"></i> <span class="stock-label-text">@Translate("label_in_stock_in_x_days", "Forventes på lager indenfor 4 dage.")</span> } else { <i class="icon-stock icon-green" title="@stock"></i> <span class="stock-label-text">@Translate("label_in_stock", "In stock")</span> } } </td> <td data-label="@Translate("Favorite", "Favorite")"> <a href="javascript:void(0)" class="productlist-list-favorite js-favorite-toggle" data-favorite-list-id="@listId" data-is-favorite="@(isFavorite ? "true" : "false")" data-product-id="@(product.GetString("Ecom:Product.ID"))" data-product-language-id="@(product.GetString("Ecom:Product.LanguageID"))" data-product-variant-id="@(product.GetString("Ecom:Product.VariantID"))"> @if (isFavorite) { <i class="icon-favorite-added" aria-hidden="true"></i> <span class="productlist-list-label sr-only">@Translate("Remove favorite", "Remove favorite")</span> } else { <i class="icon-favorite" aria-hidden="true"></i> <span class="productlist-list-label sr-only">@Translate("Make favorite", "Make favorite")</span> } </a> </td> <td id="@(string.Format("productline_price_{0}", productID))" class="productlist-table-price async-price-total" nowrap="nowrap" data-label="@Translate("Price", "Price")"> @if (Pageview.User.LoggedIn) { <i class="icon-async icon-pulse" aria-hidden="true"></i> } else { @(product.GetString("Ecom:Product.Price.PriceWithoutVAT") + " " + Context.Currency.Symbol) } </td> <td class="productlist-table-unit"> <select name="UnitId" id="prodSelector_@productID" data-product-id="@productID" class="form-control form-unit unit-input JS-ASYNC-UNITSELECTOR JS-ASYNC-INPUT-VALUE productline_variants_selector" @(units1.Count() <= 1 ? "readonly" : "") onchange=""> @foreach (var unit in units1) { <option value="@unit.UnitId" @(String.Equals(unit.UnitId, defaultUnitId1) ? "selected" : "")>@unit.UnitName</option> } </select> <div style="display:none"> @foreach (var unit in units1) { if (Pageview.User.LoggedIn) { //async prices <span id="@(string.Format("productlineunit_{0}_{1}", productID, unit.UnitId))" class="async-price" data-product-key='@(product.GetJsonPriceKey(unit.UnitId))' data-price-mode="details" data-product-retail-price='@(product.GetJsonRetailPrice())'> <span class="async-price-total" itemprop="price"> <i class="icon-async icon-pulse"></i> </span> <span class="product-price-label"><span itemprop="priceCurrency">@unit.UnitCurrencyCode</span> / @unit.UnitName</span> <br /> </span> } else { //DW prices <span id="@(string.Format("productlineunit_{0}_{1}", productID, unit.UnitId))" data-product-price='@(unit.UnitPrice)' data-product-currencycode='@(unit.UnitCurrencyCode)'> </span> } } </div> </td> @if (product.GetLoop("VariantGroups").Any()) { <td class="productlist-table-variant"> <a href="@link" class="btn btn-buy"><i class="icon-minicart" aria-hidden="true"></i> <span class="sr-only">@Translate("Buy", "Buy")</span></a> </td> } else { <td class="productlist-table-quantity"> @* For stadsing, we always have the "Single" add to cart. *@ @if (true || addToCartMode == "single") { <form class="form productlist-table-form" id="prodform_@productID" name="prodform_@product.GetString("Ecom:Product:Page.ID")" method="post" action="/Default.aspx?ID=@GetGlobalValue("Global:Page.ID")"> @product.GetString("Ecom:Product.Form.Clean") <div class="input-group"> <input name="quantity" id="quantity" value="1" type="tel" class="form-control text-center" autocomplete="off" data-trigger="focus" data-rule-number="true" data-rule-min="1" /> <span class="input-group-btn"> <button role="button" type="submit" class="btn btn-primary" title="@Translate("Add to cart", "Add to cart")"> <span class="product-added-text"><i class="pe-is-ec-cart-1-f" aria-hidden="true"></i></span> </button> </span> </div> </form> } else { <input type="tel" class="form-control qty-input text-center" onclick="this.focus();this.select();" name="Quantity@(LoopCounter)" id="Quantity@(LoopCounter)" value="@(product.GetInteger("NIQ:BasketQuantity"))" data-product-autoid="@(product.GetInteger("NIQ:ProductAutoId"))" data-tabindex="@(LoopCounter)" data-trigger="manual" /> <span class="productlist-table-added btn btn-buy qty-input-user-feedback" data-product-autoid="@(product.GetInteger("NIQ:ProductAutoId"))"> @if (product.GetInteger("NIQ:BasketQuantity") > 0) { <i class="icon-added"></i> } else { <i class="icon-minicart"></i> } </span> } </td> } </tr> } </tbody> </table> <hr class="spacer" /> } } } @if (GetLoop("ProductRelatedGroups").Any()) { foreach (var grp in GetLoop("ProductRelatedGroups")) { if (grp.GetString("Ecom:Product:RelatedGroup.GroupID").Equals("RELGRP1")) { if (grp.GetLoop("RelatedProducts").Any()) { var RelatedRow = "productlist-grid-flex"; if (grp.GetLoop("RelatedProducts").Count > 4) { RelatedRow = "slick-middle-arrow slick-flex"; <script append="true"> require(["jquery", "slick"], function($, log) { $(function() { $('#slide-products-@grp.GetString("Ecom:Product:RelatedGroup.GroupID")').slick({ slidesToShow: 4, slidesToScroll: 4, //swipeToSlide: true, infinite: true, lazyLoad: 'ondemand', nextArrow: '<a href="javascript:void()" class="slick-next slick-arrow"><i class="icon-angle-right" aria-hidden="true"></a></a>', prevArrow: '<a href="javascript:void()" class="slick-prev slick-arrow"><i class="icon-angle-left" aria-hidden="true"></a></a>', dots: true, arrows: true, responsive: [ { breakpoint: 1025, settings: { slidesToShow: 4, slidesToScroll: 4 } }, { breakpoint: 869, settings: { slidesToShow: 3, slidesToScroll: 3 } }, { breakpoint: 660, settings: { slidesToShow: 2, slidesToScroll: 2, dots: false //swipeToSlide: true } }, { breakpoint: 410, settings: { slidesToShow: 1, slidesToScroll: 1, dots: false //swipeToSlide: true } } ] }); }); }); </script> } <h2 class="title-styled"> @grp.GetString("Ecom:Product:RelatedGroup.Name") </h2> <div class="@RelatedRow" id="slide-products-@grp.GetString("Ecom:Product:RelatedGroup.GroupID")"> @foreach (var product in grp.GetLoop("RelatedProducts")) { var link = product.GetString("NIQ:ProductUrl"); var tilbud = product.GetBoolean("Ecom:Product:Field.Tilbud.Value"); var buy = "/default.aspx?ID=" + Navigation.GetPageIdByNavigationTag("ecom") + "&amp;productid=" + product.GetString("Ecom:Product.ID") + "&amp;cartcmd=add"; var area = GetGlobalValue("Global:Area.Lang"); var media = NORRIQ.EcomMedia.Frontend.GetProductMedia(product); // Favortitelist var availableFavoriteLists = (List<NORRIQ.FavoriteList.Models.FavoriteItemList> )product.GetValue("NIQ:FavoriteListsAvailable"); var favoriteListsWithProduct = (List<NORRIQ.FavoriteList.Models.FavoriteItemList> )product.GetValue("NIQ:FavoritListsWithProduct"); var isFavorite = favoriteListsWithProduct.Any(); var listId = availableFavoriteLists.Any() ? availableFavoriteLists.First().Id : 0; var addFav = Translate("label_make_favorite", "Føj til favoritter"); var delFav = Translate("label_remove_favorite", "Fjern fra favoritter"); var ProductSpecs = product.GetProductSpecifications(); var Image = ProductSpecs.GetAllByKey("Image").Any() ? "/Files/Images/XPI/" + ProductSpecs.GetByKey("Image").Value: media.GetFirstImage().Url; var isLoggedIn = Pageview.User.LoggedIn; var priceForGoogle = product.GetString("NIQ:PriceForGoogle"); var btn_addText = Translate("Add to cart", "Add to cart"); // Units var gridDefaultUnitId = product.GetString("Ecom:Product.DefaultUnitID"); var gridUnits = product.GetLoop("Units").Select(u => new { UnitId = u.GetString("Ecom:VariantOption.ID"), // Change the number format here: UnitPrice = (u.GetDouble("Ecom:VariantOption.Price.PricePIP") / 100).ToString("N"), UnitPriceDouble = (u.GetDouble("Ecom:VariantOption.Price.PricePIP") / 100d), UnitName = u.GetString("Ecom:VariantOption.Name"), UnitCurrencyCode = u.GetString("Ecom:VariantOption.Price.Currency.Code"), Stock = u.GetDouble("Ecom:VariantOption.Stock") }).OrderBy(x => x.UnitPriceDouble); var cheapestUnit = gridUnits.FirstOrDefault(); if(cheapestUnit != null) { <div class="@Columns async-price js-favProduct" data-product-display="flex" data-product-key='@(product.GetJsonPriceKey((string)cheapestUnit.UnitId))' data-product-retail-price='@(product.GetJsonRetailPrice())' data-product-units='@JsonConvert.SerializeObject(gridUnits)'> <div itemscope itemtype="http://schema.org/Product" class="productlist-grid-product"> @if (tilbud) { <div class="tilbud"><span>@Translate("Tilbud")</span></div> } <a class="productlist-grid-image" href="@link" itemprop="url"> <img src="/Admin/Public/GetImage.ashx?Width=200&amp;Height=200&amp;Crop=5&amp;Compression=80&amp;Image=@Image" class="img-responsive" alt="@product.GetString("Ecom:Product.Name")" itemprop="image" /> </a> <div class="productlist-grid-caption"> <a href="@link" class="productlist-grid-name" itemprop="name"> @product.GetString("Ecom:Product.Name") </a> </div> <div class="offer" itemprop="offers" itemscope="" itemtype="http://schema.org/Offer"> <div class="productlist-grid-info"> <span class="productlist-grid-number"> @Translate("Product Number", "Product Number") <span itemprop="sku">@product.GetString("Ecom:Product.Number")</span> </span> <span class="productlist-grid-stock"> <span class="async-price-stock" itemprop="availability"> @if (Pageview.User.LoggedIn) { <span class="icon-async icon-pulse"></span> } else { <text> @{ var stock = product.GetDouble("Ecom:Product.Stock"); var isStykliste = product.GetBoolean("Ecom:Product:Field.Stykliste.Value"); if (stock < 1 && !isStykliste) { <i class="icon-stock icon-yellow" title="@Translate("label_in_stock_in_x_days", "Forventes på lager indenfor 4 dage.")"></i> <span class="stock-label-text">@Translate("label_in_stock_in_x_days_short", "Ikke på lager")</span> } else { <i class="icon-stock icon-green" title="@stock"></i> <span class="stock-label-text">@Translate("label_in_stock", "In stock")</span> } }</text> } </span> </span> </div> <div class="productlist-grid-footer"> <div class="productlist-grid-price-info"> <div class="productlist-grid-price"> @if (Pageview.User.LoggedIn) { <span class="productlist-grid-price-price async-price-total" itemprop="price"></span> } else { <span class="productlist-grid-price-price js-price-container" itemprop="price" content="@priceForGoogle">@cheapestUnit.UnitPrice <span itemprop="priceCurrency" content="@ProductCurrency">@ProductCurrency</span></span> } </div> </div> @if (ObjectFactory.GetInstance<NORRIQ.Common8.Context.AreaItemSettings>().GetCurrentAreaValue<string>("ProductlistGridHideButton") == "False") { <div class="productlist-grid-buying"> @if (product.GetLoop("VariantGroups").Any()) { <a href="@link" class="btn btn-buy"> <span class="product-added-text">@Translate("Buy", "Buy")</span> </a> } else { <form class="form" id="prodform_@product.GetString("Ecom:Product:Page.ID")" name="prodform_@product.GetString("Ecom:Product:Page.ID")" method="post" action="/Default.aspx?ID=@GetGlobalValue("Global:Page.ID")"> @* Because of DW and their use of Default units, we have to do this the manual way: http://doc.dynamicweb.com/documentation-8/ecommerce/product-catalog/products#sideNavTitle1-2-5-4 The ones commented out has been deemed not necessary. *@ @*@GetString("Ecom:Product.Form.Clean")*@ @*<input type="hidden" name="ProductURL" id="ProductURL" value="" />*@ <input type="hidden" name="CartCmd" id="CartCmd" value="add" /> <input type="hidden" name="ProductID" id="ProductID" value="@(product.GetString("Ecom:Product.ID"))" /> <input type="hidden" name="VariantID" id="VariantID" value="" /> @*<input type="hidden" name="UnitID" id="UnitID" value="STK" />*@ @*<input type="hidden" name="wishListID" id="wishListID" value="0" />*@ @{ var unitService = ObjectFactory.GetInstance<SupplementalUnitService>(); } <div class="input-group popover-trigger"> <input name="quantity" id="quantity" value="1" min="1" max="99999" type="number" class="form-control text-center" autocomplete="off" data-trigger="focus" data-rule-number="true" data-rule-min="1" /> <span class="input-group-btn"> <select name="UnitId" class="form-control form-unit unit-input JS-ASYNC-UNITSELECTOR JS-ASYNC-INPUT-VALUE" @(gridUnits.Count() <= 1 ? "readonly" : "")> @foreach (var unit in gridUnits) { <option value="@unit.UnitId" @(String.Equals(unit.UnitId, cheapestUnit.UnitId) ? "selected" : "")>@unit.UnitName</option> } </select> </span> </div> <button role="button" type="submit" class="btn btn-primary btn-block btn-air" title="@btn_addText"> <span class="product-added-text">@btn_addText<i class="pe-is-ec-cart-1-f hide" aria-hidden="true"></i></span> </button> <div class="hide my-popover-content"> <table class="table table-condensed no-margin"> <tr> <th class="text-left">@Translate("Product pakning", "Pakning")</th> <th class="text-right">@Translate("Product indhold", "Indhold")</th> </tr> @foreach (var unit in unitService.GetSupplementalUnitByProduct(product.GetString("Ecom:Product.ID"))) { <tr> <td class="text-left">1 @unit.UnitName</td> <td class="text-right">@unit.QtyInBaseUnitOfMeasure @unit.Bom</td> </tr> } </table> </div> </form> } </div> } </div> </div> @if (isLoggedIn && !product.GetLoop("VariantGroups").Any()) { <div class="productlist-grid-buttons"> <a href="javascript:void(0)" class="js-favorite-toggle productlist-grid-favorite" data-favorite-list-id="@listId" data-is-favorite="@(isFavorite ? "true" : "false")" data-product-id="@(product.GetString("Ecom:Product.ID"))" data-product-language-id="@(product.GetString("Ecom:Product.LanguageID"))" data-product-variant-id="@(product.GetString("Ecom:Product.VariantID"))"> @if (isFavorite) { <span class="icon-favorite-added"></span> } else { <span class="icon-favorite"></span> } </a> </div> } </div> </div> } } </div> } } } } </div> </div> </section> <script append="true"> require(['jquery', 'lodash', 'standardwebshop/areas/ecom/product', 'jsrender'], function($, _, product) { var units = @JsonConvert.SerializeObject(units); var getPrices = @(Pageview.User.LoggedIn ? "true" : "false"); var productOptions = { getPrices: getPrices, asyncTemplate: $('#async-price'), unitCaptionMap: units, baseUnit: "@volumenpriser.BaseUnit", currencyCode: "@ProductCurrency", currentCulture: "@System.Globalization.CultureInfo.CurrentCulture.Name" }; product.init(productOptions); //finds product line unit selector and change prices and currency on relevant objects. $('.productline_variants_selector').on('change', function() { updateProductListPrices($(this)); }); //initialize prices if user goes back in browser $('.productline_variants_selector').each(function() { updateProductListPrices($(this)); }); function updateProductListPrices($this) { var productId = $this.data('product-id'); var prodForm = $('#prodform_' + productId); var unitId = $this.val(); var searchUnitQuery = 'productlineunit_' + productId + '_' + unitId; var searchPriceQuery = 'productline_price_' + productId; var $priceContainer = $('#' + searchPriceQuery); var unitPrice = -1; var unitCurrencyCode = ''; var $unitObj = $unitObj = $('#' + searchUnitQuery); if (getPrices) { //logged in unitPrice = $unitObj.find('.async-price-total').html(); unitCurrencyCode = $unitObj.find('[itemprop="priceCurrency"]').html(); } else { //not logged in unitPrice = $unitObj.data('product-price'); unitCurrencyCode = $unitObj.data('product-currencycode'); } $priceContainer.html(unitPrice + ' ' + unitCurrencyCode); //set unit value on form prodForm.find('#UnitID').val(unitId); } @* $('#unitIdSelector').change(function(e) { var unitId = $(this).val(); var unit = _.find(units, { UnitId: unitId }); if (getPrices) { $(this).closest('.async-price').data('product-key').UnitOfMeasure = unitId; $('.async-price-total').html($('#autoaddfeedbackloading').render()) product.calculatePrices(productOptions); } else { var unitChangeTemplate = $('#price-template-unitchange'); $('.js-price-container').html(unitChangeTemplate.render({ Price: unit.UnitPrice, Currency: unit.UnitCurrencyCode })); } // Change fee var $feeEntries = $('.js-fee-container').find("[data-fee-unit-key]"); $feeEntries.hide() $feeEntries.filter("[data-fee-unit-key='" + unitId + "']").show(); }); *@ }); require(['standardwebshop/areas/ecom/favoritelist'], function(favoriteList) { favoriteList.init(); }); </script> <script id="async-price" type="text/x-jsrender"> <div data-target=".async-price-unit"> {{if NetUnitPrice.PriceWithoutVat != UnitPrice.PriceWithoutVat}} {{>UnitPrice.PriceWithoutVat.formatMoney(2,',','.')}} {{/if}} </div> <div data-target=".async-price-stock"> {{if Inventory > 0 || (ExtraInfo && ExtraInfo.Stykliste == "yes" )}} <i class="icon-stock icon-green" title="{{>Inventory}}"></i> <span class="stock-label-text">@Translate("label_in_stock", "På lager")</span> {{else}} <i class="icon-stock icon-yellow" title="@Translate("label_in_stock_in_x_days", "Forventes på lager indenfor 4 dage.")"></i> <span class="stock-label-text">@Translate("label_in_stock_in_x_days", "Forventes på lager indenfor 4 dage.")</span> {{/if}} </div> <div data-target=".async-price-total"> {{>NetUnitPrice.PriceWithoutVat.formatMoney(2,',','.')}} {{if Mode != "details"}} @Context.Currency.Symbol {{/if}} {{if error != null }} <i class="icon-warning" title="@Translate("lwi_showing_retail_prices", "There was a technical problem so your specific price could not be calculated. The price you see is retail price.")"></i> {{/if}} </div> <div data-target=".async-price-volumenpriser"> {{if ExtraInfo && ExtraInfo.qtyPriceTransformed}} <table class="table table-block table-striped table-bordered async-price-volumenpriser"> <thead> <tr> <th>@Translate("Volume quantity", "Quantity")</th> <th class="text-right">@Translate("Volume pricePer", "Price per") ({{:ExtraInfo.BaseUnit}})</th> </tr> </thead> <tbody class="async-price-volumenpriser"> {{for ExtraInfo.qtyPriceTransformed}} <tr> {{if TranslatedUnitCaption == BaseUnit }} <td>{{:#data.MinimumQuantity}} {{:#data.TranslatedUnitCaption}}</td> {{else}} <td>{{:#data.MinimumQuantity}} {{:#data.TranslatedUnitCaption}} ({{:#data.MinimumQuantityInBaseUnit}} {{:#data.BaseUnit}})</td> {{/if}} <td class="text-right">{{:#data.ConvertedBOMPrice}} {{:#data.CurrencyCode}}</td> </tr> {{else}} <tr> <td colspan="2">Ingen volumenpriser</td> </tr> {{/for}} </tbody> </table> {{/if}} </div> </script> <script id="price-template-unitchange" type="text/x-jsrender"> {{:Price}} <span itemprop="priceCurrency" content="{{:Currency}}">{{:Currency}}</span> </script> <script type="text/x-jsrender" id="autoaddfeedbackloading"> <i class="icon-async icon-pulse"></i> </script> <script type="text/x-jsrender" id="autoaddfeedbacksuccess"> <i class="icon-added" title="@Translate("autoadd_added_to_basket", "Produktet blev tilføjet til kurven.")"></i> </script> <script type="text/x-jsrender" id="autoaddfeedbackerror"> {{if error == "badinput"}} <i class="icon-warning" title="@Translate("auto_add_bad_input", "Det indtastede var ikke et tal.")"></i> {{else error == "servererror"}} <i class="icon-warning" title="@Translate("auto_add_server_error", "Der skete en serverfejl, din kurv er ikke opdateret.")"></i> {{else}} <i class="icon-warning"></i> {{/if}} </script> <script type="text/x-jsrender" id="autoaddfeedbackdefault"> <span class="product-added-text"><i class="pe-is-ec-cart-1-f" aria-hidden="true"></i></span> </script>

Vejledninger, guides og symbolforklaring

This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.