Error executing template "Designs/Rapido/eCom/Nolist/ProductsRender.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_c6dcb0de39ba4efcb5205dd6bf7d57b1.Execute() in D:\Dynamicweb.net\Solutions\Peritus\ferno.staging.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Nolist\ProductsRender.cshtml:line 34
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using Dynamicweb.Frontend.Devices 3 @using Dynamicweb.Extensibility 4 @using Dynamicweb.Content 5 @using Dynamicweb.Core 6 @using System 7 @using System.Web 8 @using System.Linq 9 @using System.Text.RegularExpressions 10 11 @{ 12 int areaId = Int32.Parse(GetGlobalValue("Global:Area.ID")); 13 int productCatalogId = GetPageIdByNavigationTag("ProductsFeed"); 14 15 bool isFavoriteList = Int32.Parse(GetGlobalValue("Global:Page.ID")) == GetPageIdByNavigationTag("CustomerFavoritesProductlist") ? true : false; 16 if (isFavoriteList) 17 { 18 productCatalogId = GetPageIdByNavigationTag("FavoritesFeed"); 19 } 20 21 string pageUrl = GetGlobalValue("Global:Pageview.Url.Raw"); 22 string feedPageUrl = new Regex("([?&]ID)=[^?&]+").Replace(pageUrl, "?ID=" + productCatalogId); 23 string feedFullUrl = feedPageUrl + "&feedType=productCatalog"; 24 25 string requestQuery = GetGlobalValue("Global:Request.Query"); 26 27 string closeFacetsOnMobile = Pageview.Device.ToString() != "Mobile" ? "checked" : ""; 28 29 int listViewsCount = 0; 30 listViewsCount += Converter.ToBoolean(Pageview.Area.Item["ProductItemContainer"]) ? 1 : 0; 31 listViewsCount += Converter.ToBoolean(Pageview.Area.Item["ProductGridItemContainer"]) ? 1 : 0; 32 listViewsCount += Converter.ToBoolean(Pageview.Area.Item["ProductDetailsItemContainer"]) ? 1 : 0; 33 34 string listMode = Pageview.Area.Item["ProductDefaultListView"].ToString(); 35 } 36 37 <form name="multiForm" id="multiForm" method="post"> 38 <input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" /> 39 <div class="paragraph-container__grid--bleed-x paragraph-container__grid--bleed-y"> 40 <div class="grid grid--align-content-start js-ajax-container" id="productList" data-template="ProductContainer" data-pre-render-template="ProductPreRenderContainer" data-json-feed="@feedFullUrl" data-no-result-template="NoProductsFound" data-preloader="overlay"></div> 41 </div> 42 </form> 43 44 <script id="ProductPreRenderContainer" type="text/x-template"> 45 <div class="grid__col-12"> 46 <div class="pre-render-element pre-render-element--xxs"></div> 47 </div> 48 <div class="grid__col-12"> 49 <div class="pre-render-element pre-render-element--xs"></div> 50 </div> 51 @if (Pageview.Area.Item["EcommerceFacetsViewMode"].ToString() == "left" && Pageview.Device.ToString() != "Mobile") 52 { 53 <div class="grid__col-3"> 54 <div class="pre-render-element pre-render-element--xs"></div> 55 <div class="pre-render-element pre-render-element--md"></div> 56 <div class="pre-render-element pre-render-element--md"></div> 57 <div class="pre-render-element pre-render-element--md"></div> 58 </div> 59 } 60 <div class="grid__col-auto"> 61 <div class="pre-render-element pre-render-element--xs"></div> 62 <div class="pre-render-element pre-render-element--lg"></div> 63 <div class="pre-render-element pre-render-element--lg"></div> 64 <div class="pre-render-element pre-render-element--lg"></div> 65 <div class="pre-render-element pre-render-element--lg"></div> 66 </div> 67 </script> 68 69 <script id="ProductContainer" type="text/x-template"> 70 @if (Pageview.Area.Item["EcommerceFacetsViewMode"].ToString() == "top" || Pageview.Device.ToString() == "Mobile") 71 { 72 <div class="grid__col-12 grid__col--bleed-x u-margin-left u-margin-right"> 73 <input type="checkbox" id="CheckFacetGroups" class="facets-container-trigger" /> 74 <div id="FacetGroups" class="facets-container grid" data-template="facetTopGroup"></div> 75 <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod facet-selector more">@Translate("Select filters")</label> 76 <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod facet-selector less">@Translate("Close filters")</label> 77 </div> 78 } 79 80 @if (Pageview.Area.Item["EcommerceFacetsViewMode"].ToString() == "left" && Pageview.Device.ToString() != "Mobile") 81 { 82 <div class="grid__col-3"> 83 <h2>@Translate("Filters")</h2> 84 <input type="checkbox" id="CheckFacetGroups" class="facets-container-trigger" /> 85 <div id="FacetGroups" class="facets-container" data-template="facetGroup"></div> 86 <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod facet-selector more">@Translate("Select filters")</label> 87 <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod facet-selector less">@Translate("Close filters")</label> 88 </div> 89 } 90 91 <div class="grid__col-auto grid__col--bleed-x"> 92 <div class="grid__cell"> 93 <div class="u-pull--left u-margin-left"> 94 <h2><i class="{{headerIcon}}"></i>{{header}}</h2> 95 </div> 96 97 <div class="collection u-pull--right u-no-margin u-margin-right"> 98 @if (listViewsCount > 1) { 99 if (Converter.ToBoolean(Pageview.Area.Item["ProductItemContainer"])) 100 { 101 <button type="button" class="btn btn--tag btn--sm" onclick="Dynamo.UpdateTemplate('ProductsContainer', 'ProductItemContainer')"><i class="fa fa-th-list"></i></button> 102 } 103 if (Converter.ToBoolean(Pageview.Area.Item["ProductGridItemContainer"])) 104 { 105 <button type="button" class="btn btn--tag btn--sm" onclick="Dynamo.UpdateTemplate('ProductsContainer', 'ProductGridItemContainer')"><i class="fa fa-th"></i></button> 106 } 107 if (Converter.ToBoolean(Pageview.Area.Item["ProductDetailsItemContainer"])) 108 { 109 <button type="button" class="btn btn--tag btn--sm" onclick="Dynamo.UpdateTemplate('ProductsContainer', 'ProductDetailsItemContainer')"><i class="fa fa-list"></i></button> 110 } 111 } 112 113 @if (isFavoriteList) 114 { 115 <div class="u-pull--right"> 116 <button type="submit" class="btn btn--primary btn--sm dw-mod">@Translate("Buy all") <i class="fa fa-shopping-cart"></i></button> 117 </div> 118 } 119 </div> 120 121 <div class="grid"> 122 <div class="grid__col-12 grid__col--bleed-y"> 123 <div id="FacetSelections" data-template="SelectedFilter"></div> 124 </div> 125 </div> 126 127 <div id="ProductsContainer" class="grid product-list dw-mod" data-template="@listMode" data-preloader="minimal" data-save-cookie="true"></div> 128 129 <div class="grid"> 130 <div class="grid__col-12 grid__col--bleed-y"> 131 <button type="button" class="btn btn--primary btn--full {{nextdisabled}} dw-mod" data-current="{{currentPage}}" data-page-size="{{pageSize}}" data-total="{{totalPages}}" data-container="ProductsContainer" data-feed-url="/Default.aspx?ID=@productCatalogId" onclick="LoadMore.Next(this)" {{nextdisabled}}>@Translate("Load") {{pageSize}} @Translate("more")</button> 132 <button type="button" class="btn btn--clean" onclick="window.scroll(0, 0)">@Translate("Return to top")</button> 133 </div> 134 </div> 135 </div> 136 </div> 137 </script> 138 139 <script id="PageButton" type="text/x-template"> 140 <li class="{{active}}"><a href="{{url}}">{{number}}</a></li> 141 </script> 142 143 @* Facets templates *@ 144 145 <script id="facetGroup" type="text/x-template"> 146 <input type="checkbox" id="OptionsGroup_{{counter}}" class="expand-trigger js-remember-state" @closeFacetsOnMobile /> 147 148 <div class="expand-box expand-container dw-mod"> 149 <label class="expand-box__header expand-container__btn dw-mod" for="OptionsGroup_{{counter}}">{{name}}</label> 150 <div id="FacetOptions" class="expand-box__content expand-container__content expand-container__content--limit-height dw-mod"></div> 151 </div> 152 </script> 153 154 <script id="facetTopGroup" type="text/x-template"> 155 <div class="grid__col-lg-3 grid__col-md-3 grid__col-sm-4 grid__col-xs-12"> 156 <input type="checkbox" id="OptionsGroup_{{counter}}" class="dropdown-trigger" /> 157 <div class="dropdown dw-mod"> 158 <label class="dropdown__header dropdown__btn dw-mod" for="OptionsGroup_{{counter}}">{{name}}</label> 159 <div id="FacetOptions" class="dropdown__content dropdown__content--padding dw-mod"></div> 160 <label class="dropdown-trigger-off" for="OptionsGroup_{{counter}}"></label> 161 </div> 162 </div> 163 </script> 164 165 <script id="Range" type="text/x-template"> 166 <div> 167 <label class="{{disabled}}"> 168 <input type="checkbox" class="{{selected}}" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="{{value}}" {{selected}} {{disabled}}> 169 {{label}} {{currency}} <span class="u-color-light-gray u-pull--right">({{count}})</span> 170 </label> 171 </div> 172 </script> 173 174 <script id="Weight" type="text/x-template"> 175 <div> 176 <label class="{{disabled}}"> 177 <input type="checkbox" class="{{selected}}" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="{{value}}" {{selected}} {{disabled}}> 178 {{label}} {{weight}} <span class="u-color-light-gray u-pull--right">({{count}})</span> 179 </label> 180 </div> 181 </script> 182 183 <script id="Checkboxes" type="text/x-template"> 184 <div> 185 <label class="{{disabled}}"> 186 <input type="checkbox" class="{{selected}}" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="{{value}}" {{selected}} {{disabled}}> 187 {{label}} <span class="u-color-light-gray u-pull--right">({{count}})</span> 188 </label> 189 </div> 190 </script> 191 192 <script id="Tags" type="text/x-template"> 193 <button type="button" class="btn btn--tag {{selected}} {{disabled}}" data-check="{{selected}}" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="{{value}}" {{disabled}}> 194 {{label}} <span class="facets-group__counter">({{count}})</span> 195 </button> 196 </script> 197 198 <script id="Colors" type="text/x-template"> 199 <button type="button" class="btn btn--colorbox u-margin-right {{selected}} {{disabled}}" style="background-color: {{value}}" title="{{label}}" data-check="{{selected}}" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="{{value}}" {{disabled}}></button> 200 </script> 201 202 <script id="SelectedFilter" type="text/x-template"> 203 <button type="button" class="btn btn--tag" data-check="checked" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="{{value}}" title="@Translate("Remove filter")"> 204 {{group}}: {{label}} <i class="fa fa-times"></i> 205 </button> 206 </script> 207 208 <script id="SelectedColorFilter" type="text/x-template"> 209 <button type="button" class="btn btn--tag" data-check="checked" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="{{value}}" title="@Translate("Remove filter")"> 210 {{group}}: <div class="btn__colorbox" style="background-color: {{label}}"></div> <i class="fa fa-times"></i> 211 </button> 212 </script> 213 214 <script id="ResetFilters" type="text/x-template"> 215 <button type="button" class="btn btn--tag" onclick="Facets.ResetFacets(this);"> 216 @Translate("Reset all filters") <i class="fa fa-rotate-left"></i> 217 </button> 218 </script> 219 220 @* Product list templates *@ 221 222 @* List view *@ 223 224 <script id="ProductItemContainer" type="text/x-template"> 225 <div id="Product" class="grid__col-12" data-template="ProductItem" data-preloader="false"></div> 226 </script> 227 228 <script id="ProductItem" type="text/x-template"> 229 <input type="hidden" name="ProductLoopCounter{{uniqueId}}" value="{{uniqueId}}" /> 230 <input type="hidden" name="ProductID{{uniqueId}}" value="{{id}}" /> 231 232 <div class="grid product-list__list-item dw-mod"> 233 <div class="grid__col-md-4 {{noImage}} product-list__list-item__left dw-mod"> 234 <div class="grid__cell"> 235 <div class="sticker {{onSale}} dw-mod">@Translate("Sale!")</div> 236 <a href="{{link}}" onclick="Scroll.SavePosition(event)"><img class="grid__cell-img grid__cell-img--centered" src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;image={{image}}" alt="{{name}}" /></a> 237 </div> 238 </div> 239 <div class="grid__col-md-auto product-list__list-item__right dw-mod"> 240 <div> 241 <div class="u-pull--left"> 242 <a href="{{link}}" onclick="Scroll.SavePosition(event)" title="{{name}}"><h2 class="u-condensed-text u-max-w340px">{{name}}</h2></a> 243 <div class="item-number dw-mod">{{number}}</div> 244 </div> 245 <div id="Favorite" data-template="FavoriteTemplate" class="favorites u-pull--right {{hasVariants}} dw-mod" {{hasVariants}}></div> 246 </div> 247 248 <div class="grid__cell"> 249 {{description}} 250 </div> 251 252 @* Combinations div needed to handle variant options(used in script block with Variants.SetVariantOptionStatesForProductList function) and should not be deleted *@ 253 <div id="Combinations" data-template="VariantCombinations" data-product-id="{{id}}" class="js-variants-wrap u-hidden"></div> 254 <div id="Variants" data-template="VariantGroup" data-product-id="{{id}}"></div> 255 <small id="helpText_{{id}}" class="help-text {{hideViewMore}} {{hideHelpText}}">@Translate("Please select variant!")</small> 256 257 <div class="grid__cell-footer"> 258 <div class="grid__cell"> 259 <div class="product-list__list-item__price-actions dw-mod"> 260 <div class="u-margin-bottom"> 261 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 262 <div class="price dw-mod">{{price}} </div> @Translate("inkl. MVA") 263 </div> 264 <div class="buttons-collection buttons-collection--right"> 265 <button type="button" id="CartButton_{{id}}" class="{{hasBuyOption}}-hibe-buy btn btn--primary btn--condensed u-pull--right dw-mod {{hasVariants}}" name="submit" onclick="Cart.AddToCart(event, '{{id}}', document.getElementById('Quantity_{{id}}').value, 'Unit_{{id}}', 'Variant_{{id}}');" {{hasVariants}}><i class="fa fa-shopping-cart"></i><span class="u-hidden-xs u-hidden-xxs"> @Translate("Add to cart")</span></button> 266 <input type="number" class="{{hasBuyOption}}-hibe-buy u-w80px u-pull--right" id="Quantity_{{id}}" name="Quantity{{uniqueId}}" value="1" min="1"> 267 268 <input type="checkbox" id="UnitOptions_{{id}}" class="dropdown-trigger" /> 269 <div class="dropdown u-w110px u-w100px--xs {{hasUnits}} dw-mod"> 270 <label class="dropdown__header dropdown__btn dw-mod" for="UnitOptions_{{id}}">{{unitName}}</label> 271 <div id="unitOptions" data-template="UnitOption" class="dropdown__content dw-mod"></div> 272 <label class="dropdown-trigger-off" for="UnitOptions_{{id}}"></label> 273 </div> 274 <input type="hidden" value="{{unitId}}" name="Unit{{uniqueId}}" id="Unit_{{id}}" /> 275 <input type="hidden" value="{{variantid}}" name="VariantID{{uniqueId}}" id="Variant_{{id}}" /> 276 </div> 277 <div class="u-pull--right {{hasBuyOption}}-view"> 278 <a href="{{link}}" class="btn btn--secondary u-no-margin u-w130px dw-mod" title="{{name}}">@Translate("View")</a> 279 </div> 280 </div> 281 </div> 282 </div> 283 </div> 284 </div> 285 </script> 286 287 @* Grid view *@ 288 289 <script id="ProductGridItemContainer" type="text/x-template"> 290 <div id="Product" class="grid__col-lg-4 grid__col-md-4 grid__col-sm-4 grid__col-xs-6 product-list__list-item dw-mod" data-template="ProductGridItem" data-preloader="false"></div> 291 </script> 292 293 <script id="ProductGridItem" type="text/x-template"> 294 <input type="hidden" name="ProductLoopCounter{{uniqueId}}" value="{{uniqueId}}" /> 295 <input type="hidden" name="ProductID{{uniqueId}}" value="{{id}}" /> 296 297 <div class="grid__cell product-list__grid-item__image dw-mod {{noImage}}"> 298 <div class="sticker {{onSale}} dw-mod">@Translate("Sale!")</div> 299 <a href="{{link}}" onclick="Scroll.SavePosition(event)"><img class="grid__cell-img grid__cell-img--centered" src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;image={{image}}" alt="{{name}}" /></a> 300 </div> 301 302 <div class="grid__cell product-list__grid-item__price-info dw-mod"> 303 <a href="{{link}}" onclick="Scroll.SavePosition(event)" title="{{name}}"><h4 class="u-condensed-text productHeadingFixes">{{name}}</h4></a> 304 <div class="item-number dw-mod">{{number}}</div> 305 <div class="price dw-mod">{{price}}</div> @Translate("inkl. MVA") 306 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 307 <input type="hidden" id="Quantity_{{id}}" name="Quantity{{uniqueId}}" value="1" min="1"> 308 <input type="hidden" value="{{unitId}}" name="Unit{{uniqueId}}" id="Unit_{{id}}" /> 309 <input type="hidden" value="{{variantid}}" name="VariantID{{uniqueId}}" id="Variant_{{id}}" /> 310 </div> 311 312 <div class="product-list__grid-item__footer dw-mod"> 313 <div class="u-ta-center"> 314 <a href="{{link}}" id="CartButton_{{id}}" class="btn btn--secondary btn--full u-no-margin dw-mod">@Translate("View")</a> 315 </div> 316 </div> 317 </script> 318 319 @* Details view *@ 320 321 <script id="ProductDetailsItemContainer" type="text/x-template"> 322 <div id="Product" class="grid__col-md-12 product-list__details-item dw-mod" data-template="ProductDetailsItem" data-preloader="false" style="z-index: {{zIndex}}"></div> 323 </script> 324 325 <script id="ProductDetailsItem" type="text/x-template"> 326 <input type="hidden" name="ProductLoopCounter{{uniqueId}}" value="{{uniqueId}}" /> 327 <input type="hidden" name="ProductID{{uniqueId}}" value="{{id}}" /> 328 329 <div class="grid__cell"> 330 <div class="product-list__details-item__left dw-mod"> 331 <div class="micro-sticker {{onSale}} u-hidden-xxs dw-mod">@Translate("Sale!")</div> 332 <div class="lightbox u-hidden-xxs"> 333 <a href="{{link}}" onclick="Scroll.SavePosition(event)"> 334 <img class="lightbox__image {{noImage}}" src="/Admin/Public/GetImage.ashx?width=220&amp;height=220&amp;crop=5&amp;Compression=75&amp;image={{image}}" alt="{{name}}" /> 335 <div class="u-w40px u-margin-right {{noImage}}"> 336 <img src="/Admin/Public/GetImage.ashx?width=40&amp;height=40&amp;crop=5&amp;Compression=75&amp;image={{image}}" alt="{{name}}" /> 337 </div> 338 </a> 339 </div> 340 <div class="u-margin-right"> 341 <a href="{{link}}" onclick="Scroll.SavePosition(event)" title="{{name}}"><h5 class="u-condensed-text u-max-w220px productHeadingFixes">{{name}}</h5></a> 342 <div class="item-number dw-mod">{{number}} <span class="stock-icon {{stockState}} dw-mod" title=""></span></div> 343 </div> 344 </div> 345 <div class="product-list__details-item__right dw-mod"> 346 <div class="grid__cell u-hidden-sm u-hidden-md u-hidden-lg"> 347 <div class="u-full-width u-ta-right"> 348 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 349 <div class="price price--condensed dw-mod">{{price}}</div> @Translate("inkl. MVA") 350 </div> 351 </div> 352 <div class="grid__cell grid__cell--align-middle-right"> 353 <div class="u-pull--right u-margin-right"> 354 <input type="checkbox" id="UnitOptions_{{id}}" class="dropdown-trigger" /> 355 <div class="dropdown u-w120px {{hasUnits}} dw-mod"> 356 <label class="dropdown__header dropdown__btn dw-mod" for="UnitOptions_{{id}}">{{unitName}}</label> 357 <div id="unitOptions" data-template="UnitOption" class="dropdown__content dw-mod"></div> 358 <label class="dropdown-trigger-off" for="UnitOptions_{{id}}"></label> 359 </div> 360 <input type="hidden" value="{{unitId}}" name="Unit{{uniqueId}}" id="Unit_{{id}}" /> 361 <input type="hidden" value="{{variantid}}" name="VariantID{{uniqueId}}" id="Variant_{{id}}" /> 362 </div> 363 <div class="u-pull--right u-margin-right u-w100px u-ta-right u-hidden-xs u-hidden-xxs"> 364 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 365 <div class="price price--condensed dw-mod">{{price}}</div> @Translate("inkl. MVA") 366 </div> 367 <div class="u-pull--right {{hideBuyOptions}}"> 368 <input type="number" class="u-w80px u-no-margin u-margin-right" id="Quantity_{{id}}" name="Quantity{{uniqueId}}" value="1" min="1"> 369 </div> 370 <div class="u-pull--right {{hideBuyOptions}}"> 371 <button type="button" id="CartButton_{{id}}" class="btn btn--primary btn--condensed u-no-margin dw-mod {{hasVariants}}" name="submit" onclick="Cart.AddToCart(event, '{{id}}', document.getElementById('Quantity_{{id}}').value, 'Unit_{{id}}');" {{hasVariants}}><i class="fa fa-shopping-cart"></i></button> 372 </div> 373 <div class="u-pull--right {{hideViewMore}}"> 374 <a href="{{link}}" class="btn btn--secondary u-no-margin u-w130px dw-mod" onclick="Scroll.SavePosition(event)" title="{{name}}">@Translate("View")</a> 375 </div> 376 <div id="Favorite" data-template="FavoriteTemplate" class="favorites favorites--lg u-hidden {{hasVariants}} u-hidden-xs u-hidden-xxs dw-mod" {{hasVariants}}></div> 377 </div> 378 </div> 379 </div> 380 </script> 381 382 @* Units templates *@ 383 384 <script id="UnitOption" type="text/x-template"> 385 <div class="dropdown__item dw-mod" onclick="Dynamo.UpdateContent('Product{{productId}}', '{{link}}&LayoutTemplate=Json.cshtml&DisableStatistics=True&feedType=productCatalog&UnitID={{value}}')">{{name}}</div> 386 </script> 387 388 @* Variants templates *@ 389 390 <script id="VariantGroup" type="text/x-template"> 391 <div> 392 <div class="u-bold">{{name}}</div> 393 <div id="VariantOptions" data-template="VariantOption"></div> 394 </div> 395 </script> 396 397 <script id="VariantOption" type="text/x-template"> 398 <button type="button" id="{{id}}" data-product-id="{{productid}}" onclick="Variants.UpdateVariants(this)" class="btn btn--tag {{disabled}} {{selected}}" data-check="{{selected}}" {{disabled}}>{{name}}</button> 399 </script> 400 401 <script id="VariantOptionImage" type="text/x-template"> 402 <img src="/Admin/Public/GetImage.ashx?width=100&amp;height=50&amp;crop=5&amp;Compression=75&amp;image=/Images/{{image}}" title="{{name}}" id="{{id}}" data-product-id="{{productid}}" onclick="Variants.UpdateVariants(this)" class="btn btn--tag {{disabled}} {{selected}}" data-check="{{selected}}" {{disabled}} /> 403 </script> 404 405 <script id="VariantCombinations" type="text/x-template"></script> 406 407 @* Favorites templates *@ 408 409 <script id="FavoriteTemplate" type="text/x-template"> 410 <div class="favorites-list u-pull--right u-ta-left"> 411 <i class="{{favoriteIcon}} fa-1_5x"></i> 412 <div class="favorites-list__container dw-mod"> 413 <ul id="FavoriteLists" data-template="FavoriteListItem" class="list list--clean dw-mod"></ul> 414 </div> 415 </div> 416 </script> 417 418 <script id="FavoriteListItem" type="text/x-template"> 419 <li> 420 <a href="{{link}}" class="list__link dw-mod"><i class="{{favoriteIcon}}"></i> {{name}}</a> 421 </li> 422 </script> 423 424 @* No products found *@ 425 426 <script id="NoProductsFound" type="text/x-template"> 427 <div class="grid__col-12"> 428 <h2 class="u-ta-center">@Translate("No products found")</h2> 429 </div> 430 </script> 431 432 433 <script> 434 document.addEventListener("DOMContentLoaded", function (event) { 435 Facets.Init("productList", '@productCatalogId', '@requestQuery'); 436 437 Variants.SetProductFeedId('@productCatalogId'); 438 Variants.SetViewMode("productList"); 439 440 document.getElementById("productList").addEventListener('contentLoaded', function (e) { 441 if (e.srcElement.classList.contains("js-variants-wrap")) { 442 Variants.SetVariantOptionStatesForProductList(e.srcElement); 443 } 444 }, false); 445 }); 446 </script>