Error executing template "Designs/Rapido/eCom/Productlist/ProductsRenderCustom.cshtml"
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.d__64`1.MoveNext()
   at Dynamicweb.Ecommerce.Assortments.AssortmentService.HasAccessToGroup(Group group, User user)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.MakeGroupTree(GroupCollection groups, Page page, NavigationItem parentNode, Int32 thisLevel, Int32 maxLevel, Page productPage)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.MakeGroupTree(Page page, NavigationItem parentNode)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.Process(NavigationItem node)
   at Dynamicweb.Ecommerce.Frontend.NavigationProviders.GroupNavigationProvider.ProcessTree(RootNavigationItem rootNode, NavigationType navigationType)
   at Dynamicweb.Frontend.XmlNavigation.MakeXml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, Int32 selectedAreaId)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, String name, String xsltPath, Int32 selectedAreaId, Boolean sitemapMode, NameValueCollection settings, NameValueCollection attributes, IncludeMode mode)
   at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(NameValueCollection settings, NameValueCollection attributes)
   at CompiledRazorTemplates.Dynamic.RazorEngine_6271c95b35f042f09181128b2a351390.b__22_0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\Dynamicweb\aedgroup.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ProductsRenderCustom.cshtml:line 1923
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_6271c95b35f042f09181128b2a351390.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\Dynamicweb\aedgroup.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ProductsRenderCustom.cshtml:line 168
   at CompiledRazorTemplates.Dynamic.RazorEngine_6271c95b35f042f09181128b2a351390.<>c__DisplayClass1_0.b__0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\Dynamicweb\aedgroup.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ProductsRenderCustom.cshtml:line 82
   at CompiledRazorTemplates.Dynamic.RazorEngine_6271c95b35f042f09181128b2a351390.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\Dynamicweb\aedgroup.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ProductsRenderCustom.cshtml:line 190
   at CompiledRazorTemplates.Dynamic.RazorEngine_6271c95b35f042f09181128b2a351390.<>c__DisplayClass1_0.b__0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\Dynamicweb\aedgroup.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ProductsRenderCustom.cshtml:line 110
   at CompiledRazorTemplates.Dynamic.RazorEngine_6271c95b35f042f09181128b2a351390.b__29_0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\Dynamicweb\aedgroup.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ProductsRenderCustom.cshtml:line 3063
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_6271c95b35f042f09181128b2a351390.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\Dynamicweb\aedgroup.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ProductsRenderCustom.cshtml:line 168
   at CompiledRazorTemplates.Dynamic.RazorEngine_6271c95b35f042f09181128b2a351390.<>c__DisplayClass1_0.b__0(TextWriter __razor_helper_writer) in D:\Dynamicweb.net\Solutions\Dynamicweb\aedgroup.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ProductsRenderCustom.cshtml:line 82
   at CompiledRazorTemplates.Dynamic.RazorEngine_6271c95b35f042f09181128b2a351390.Execute() in D:\Dynamicweb.net\Solutions\Dynamicweb\aedgroup.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\eCom\Productlist\ProductsRenderCustom.cshtml:line 3046
   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.IO 8 @using System.Web 9 @using System.Collections.Generic; 10 @using System.Linq 11 @using System.Text.RegularExpressions 12 @using Dynamicweb.Rapido.Blocks 13 14 @functions { 15 BlocksPage productListPage = BlocksPage.GetBlockPage("ProductList"); 16 } 17 18 @{ 19 Block pageContainer = new Block() 20 { 21 Id = "PageContainer", 22 Template = RenderPageContainer(), 23 SkipRenderBlocksList = true 24 }; 25 productListPage.Add(pageContainer); 26 27 Block productListNavigation = new Block() 28 { 29 Id = "Navigation", 30 SortId = 20, 31 Design = new Design 32 { 33 RenderType = RenderType.Column, 34 Size = Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet" ? "12" : "3" 35 } 36 }; 37 productListPage.Add("PageContainer", productListNavigation); 38 39 Block productListContainer = new Block() 40 { 41 Id = "ProductList", 42 SortId = 30, 43 Template = RenderProductList(), 44 SkipRenderBlocksList = true 45 }; 46 productListPage.Add("PageContainer", productListContainer); 47 48 Block productListSnippets = new Block() 49 { 50 Id = "BottomSnippets", 51 SortId = 40 52 }; 53 productListPage.Add(productListSnippets); 54 } 55 56 @* This is required for the product list feed to work *@ 57 @GetValue("DoNotRenderProductListTemplate") 58 59 @* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@ 60 @using System.Text.RegularExpressions 61 @using System.Collections.Generic 62 @using System.Reflection 63 @using System.Web.UI.HtmlControls 64 @using Dynamicweb.Rapido.Blocks.Components 65 @using Dynamicweb.Rapido.Blocks.Components.Articles 66 @using Dynamicweb.Rapido.Blocks.Components.Documentation 67 @using Dynamicweb.Rapido.Blocks 68 69 70 @*--- START: Base block renderers ---*@ 71 72 @helper RenderBlockList(List<Block> blocks) 73 { 74 blocks = blocks.OrderBy(item => item.SortId).ToList(); 75 76 foreach (Block item in blocks) 77 { 78 <!-- START: @item.Id --> 79 80 if (item.Design == null) 81 { 82 @RenderBlock(item) 83 } 84 else if (item.Design.RenderType == RenderType.None) { 85 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 86 87 <div class="@cssClass dw-mod"> 88 @RenderBlock(item) 89 </div> 90 } 91 else if (item.Design.RenderType != RenderType.Hide) 92 { 93 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 94 95 if (!item.SkipRenderBlocksList) { 96 if (item.Design.RenderType == RenderType.Row) 97 { 98 <div class="grid grid--align-content-start @cssClass dw-mod" id="Block__@item.Id"> 99 @RenderBlock(item) 100 </div> 101 } 102 103 if (item.Design.RenderType == RenderType.Column) 104 { 105 string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; 106 string size = item.Design.Size ?? "12"; 107 size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; 108 109 <div class="grid__col-lg-@item.Design.Size grid__col-md-@item.Design.Size grid__col-sm-12 grid__col-xs-12 @hidePadding @cssClass dw-mod" id="Block__@item.Id"> 110 @RenderBlock(item) 111 </div> 112 } 113 114 if (item.Design.RenderType == RenderType.Table) 115 { 116 <table class="table @cssClass dw-mod" id="Block__@item.Id"> 117 @RenderBlock(item) 118 </table> 119 } 120 121 if (item.Design.RenderType == RenderType.TableRow) 122 { 123 <tr class="@cssClass dw-mod" id="Block__@item.Id"> 124 @RenderBlock(item) 125 </tr> 126 } 127 128 if (item.Design.RenderType == RenderType.TableColumn) 129 { 130 <td class="@cssClass dw-mod" id="Block__@item.Id"> 131 @RenderBlock(item) 132 </td> 133 } 134 135 if (item.Design.RenderType == RenderType.CardHeader) 136 { 137 <div class="card-header @cssClass dw-mod"> 138 @RenderBlock(item) 139 </div> 140 } 141 142 if (item.Design.RenderType == RenderType.CardBody) 143 { 144 <div class="card @cssClass dw-mod"> 145 @RenderBlock(item) 146 </div> 147 } 148 149 if (item.Design.RenderType == RenderType.CardFooter) 150 { 151 <div class="card-footer @cssClass dw-mod"> 152 @RenderBlock(item) 153 </div> 154 } 155 } 156 else 157 { 158 @RenderBlock(item) 159 } 160 } 161 162 <!-- END: @item.Id --> 163 } 164 } 165 166 @helper RenderBlock(Block item) 167 { 168 if (item.Template != null) 169 { 170 @BlocksPage.RenderTemplate(item.Template) 171 } 172 173 if (item.Component != null) 174 { 175 string methodName = item.Component.HelperName; 176 dynamic[] methodParameters = new dynamic[1]; 177 methodParameters[0] = item.Component; 178 Type methodType = this.GetType(); 179 MethodInfo generalMethod = methodType.GetMethod(methodName); 180 181 if (generalMethod != null) { 182 @generalMethod.Invoke(this, methodParameters).ToString(); 183 } else { 184 throw new Exception(item.Component.GetType().Name + " method '" + methodName +"' could not be invoked"); 185 } 186 } 187 188 if (item.BlocksList.Count > 0 && !item.SkipRenderBlocksList) 189 { 190 @RenderBlockList(item.BlocksList) 191 } 192 } 193 194 @*--- END: Base block renderers ---*@ 195 196 197 @* Include the Blocks for the page *@ 198 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 199 @using Dynamicweb.Core 200 @using System 201 @using System.Web 202 @using System.Collections.Generic 203 @using Dynamicweb.Rapido.Blocks 204 205 @{ 206 BlocksPage productListProductsBlocksPage = BlocksPage.GetBlockPage("ProductList"); 207 208 Block productsBlock = new Block 209 { 210 Id = "Views", 211 SortId = 30, 212 Template = RenderProducts() 213 }; 214 215 productListProductsBlocksPage.Add("ProductList", productsBlock); 216 } 217 218 @helper RenderProducts() 219 { 220 @*This is part of a script template *@ 221 222 <div id="ProductsContainer" data-template="{{listTemplate}}" class="grid product-list grid--external-bleed-x dw-mod" data-save-cookie="true"> 223 {{#ProductsContainer}} 224 {{> (lookup . 'template') }} 225 {{/ProductsContainer}} 226 </div> 227 } 228 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 229 @using Dynamicweb.Core 230 @using System 231 @using System.Web 232 @using System.Collections.Generic 233 @using Dynamicweb.Rapido.Blocks 234 235 @if (Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableListView")) 236 { 237 BlocksPage productList = BlocksPage.GetBlockPage("ProductList"); 238 239 Block listViewButton = new Block 240 { 241 Id = "ProductItemContainer", 242 Name = "th-list", 243 SortId = 10 244 }; 245 productList.Add("Views", listViewButton); 246 247 Block listViewScripts = new Block 248 { 249 Id = "ListViewScripts", 250 SortId = 20, 251 Template = ListView() 252 }; 253 productList.Add("BottomSnippets", listViewScripts); 254 } 255 256 @helper ListView() 257 { 258 string pageId = GetGlobalValue("Global:Page.ID"); 259 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 260 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 261 bool showPrice = !Pageview.AreaSettings.GetItem("ProductList").GetBoolean("HidePrice"); 262 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 263 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("ShowAddToCartButton"); 264 bool showViewButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("ShowViewButton"); 265 bool showFavoriteButton = !Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("HideFavoriteButton"); 266 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("ShowAddToDownloadButton"); 267 bool showStock = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("ShowStockAndShipping"); 268 bool showNumber = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("ShowProductNumber"); 269 bool showVariantSelector = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetList("Variants").SelectedValue == "selector" ? true : false; 270 bool showStaticVariants = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetList("Variants").SelectedValue == "static" ? true : false; 271 string viewMoreText = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetString("ViewMoreText")) ? Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetString("ViewMoreText") : "View"; 272 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 273 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 274 bool isPricesWithVATEnabled = Dynamicweb.Core.Converter.ToBoolean(Pageview.Area.EcomPricesWithVat); 275 string imageZoomOnHover = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("HoverImageZoom") ? "image-hover--zoom" : ""; 276 bool secondaryImage = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetString("HoverAlternatineImage") != null ? Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("HoverAlternatineImage") : false; 277 278 <script id="ProductItemContainer" type="text/x-template"> 279 {{#.}} 280 <div id="Product{{id}}" class="grid__col-12 js-product dw-mod" data-template="ProductItem" data-preloader="overlay"> 281 {{#Product}} 282 {{>ProductItem}} 283 {{/Product}} 284 </div> 285 {{/.}} 286 </script> 287 288 <script id="ProductItem" type="text/x-template"> 289 {{#.}} 290 @if (useGoogleTagManager) 291 { 292 <text>{{{googleEnchantImpression 'Product catalogue' currency googleImpression}}}</text> 293 } 294 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 295 <input type="hidden" name="ProductID{{id}}" value="{{productId}}" /> 296 <input type="hidden" value="{{variantid}}" name="VariantID{{id}}" id="Variant_{{id}}" /> 297 298 <div class="grid product-list__list-item dw-mod"> 299 <div class="grid__col-md-4 {{noImage}} product-list__list-item__left u-no-padding u-color-light--bg dw-mod @imageZoomOnHover"> 300 <div class="grid__cell"> 301 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{name}}" class="u-position-relative u-block image-hover__wrapper dw-mod"> 302 <img class="grid__cell-img grid__cell-img--centered b-lazy" src="/Files/Images/placeholder.gif" 303 data-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=true&amp;FillCanvas=true&amp;image={{image}}" 304 @if (secondaryImage) { 305 <text> 306 {{#if secondaryImage}} 307 data-secondary-image-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;FillCanvas=true&amp;DoNotUpscale=true&amp;image={{secondaryImage}}" 308 {{/if}} 309 </text> 310 } 311 alt="{{name}}" /> 312 {{#StickersContainers}} 313 {{>StickersContainer}} 314 {{/StickersContainers}} 315 </a> 316 </div> 317 </div> 318 <div class="grid__col-md-auto product-list__list-item__right dw-mod"> 319 <div> 320 <div class="u-pull--left"> 321 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{name}}"> 322 <h2 class="u-no-margin">{{name}}</h2> 323 </a> 324 325 @if (showNumber) 326 { 327 <div class="item-number dw-mod">{{number}}</div> 328 } 329 330 @if (!onlyPreview && showStock) 331 { 332 <div> 333 <span class="stock-icon {{stockState}} u-no-margin dw-mod" title="{{stockText}}"></span> 334 <span class="u-margin-right--lg"> {{stockText}}</span> 335 {{deliveryText}} 336 </div> 337 } 338 339 </div> 340 341 @if (showFavoriteButton) 342 { 343 <div class="favorites u-pull--right {{hasVariants}} dw-mod" {{hasVariants}}> 344 {{#Favorite}} 345 {{>FavoriteTemplate}} 346 {{/Favorite}} 347 </div> 348 } 349 </div> 350 351 <div class="grid__cell u-margin-top u-margin-bottom"> 352 {{{description}}} 353 </div> 354 355 @if (showCartButton && showVariantSelector) 356 { 357 <div data-template="VariantsTemplate" class="js-variants grid__cell" data-combinations="{{combinationsStringArray}}" data-variants="{{variantsStringArray}}" data-variant-selections="{{variantSelections}}" data-total-variant-groups="{{variantGroupsCount}}" data-selection-complete="UpdateData" data-page-id="@pageId" data-product-id="{{productId}}"> 358 {{#Variants}} 359 {{>VariantsTemplate}} 360 {{/Variants}} 361 </div> 362 <small class="js-help-text help-text {{hideViewMore}} {{hideHelpText}}">@Translate("Please select variant!")</small> 363 } 364 365 @if (showStaticVariants) 366 { 367 <text> 368 {{#Variants}} 369 {{>StaticVariantsTemplate}} 370 {{/Variants}} 371 {{#ifCond variantGroupsCount '>' 1}} 372 <div class="static-variant"> 373 @Translate("More options available") 374 </div> 375 {{/ifCond}} 376 </text> 377 } 378 379 @if (!onlyPreview) 380 { 381 <div class="grid__cell-footer"> 382 <div class="grid__cell"> 383 <div class="product-list__list-item__price-actions dw-mod"> 384 @if (showPrice) 385 { 386 <div class="u-margin-bottom"> 387 @if (pointShopOnly) 388 { 389 <text> 390 {{#if havePointPrice}} 391 <div class="price price--product-list dw-mod">{{points}} @Translate("points")</div> 392 {{else}} 393 @Translate("Not available") 394 {{/if}} 395 </text> 396 } 397 else 398 { 399 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 400 <div class="price price--product-list dw-mod">{{price}}</div> 401 if (showVATPrice) 402 { 403 <small class="vat-price vat-price--product-list dw-mod"> 404 @if (isPricesWithVATEnabled) 405 { 406 @Translate("excl. VAT") <text>({{priceWithoutVAT}})</text> 407 } 408 else 409 { 410 @Translate("incl. VAT") <text>({{priceWithVAT}})</text> 411 } 412 </small> 413 } 414 } 415 </div> 416 } 417 418 @if (showCartButton) 419 { 420 string hasVariantsClass = ""; 421 if (!showVariantSelector) 422 { 423 hasVariantsClass = "{{hasVariants}}"; 424 } 425 426 if (pointShopOnly) 427 { 428 <text> 429 {{#unless canBePurchasedWithPoints}} 430 {{#if havePointPrice}} 431 <small class="help-text u-no-margin u-margin-bottom">@Translate("Not enough points to buy this")</small> 432 {{/if}} 433 {{/unless}} 434 </text> 435 } 436 <div class="buttons-collection buttons-collection--right @hasVariantsClass"> 437 @if (pointShopOnly) 438 { 439 <button type="button" id="CartButton_{{id}}" class="btn btn--primary btn--condensed u-no-margin dw-mod u-pull--right js-cart-btn {{disabledBuyButton}} {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 440 onclick="Cart.AddToCart(event, { 441 id: '{{productId}}', 442 variantId: '{{variantid}}', 443 unitId: '{{unitId}}', 444 quantity: 1, 445 buyForPoints: true, 446 productInfo: {{productInfo}} 447 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 448 <i class="@cartIcon"></i><span class="u-hidden-xs u-hidden-xxs"> @Translate("Buy with points")</span> 449 </button> 450 } 451 else 452 { 453 <button type="button" id="CartButton_{{id}}" class="js-cart-btn btn btn--primary btn--condensed u-pull--right dw-mod {{disabledBuyButton}}" name="submit" 454 onclick="Cart.AddToCart(event, { 455 id: '{{productId}}', 456 variantId: '{{variantid}}', 457 unitId: '{{unitId}}', 458 quantity: document.getElementById('Quantity_{{id}}').value, 459 productInfo: {{productInfo}} 460 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 461 <i class="@cartIcon"></i><span class="u-hidden-xs u-hidden-xxs"> @Translate("Add to cart")</span> 462 </button> 463 <input type="number" class="u-w80px u-margin-right u-pull--right use-btn-primary-height" id="Quantity_{{id}}" name="Quantity{{id}}" value="1" min="1"> 464 } 465 466 <input type="checkbox" id="UnitOptions_{{id}}" class="dropdown-trigger" /> 467 <div class="dropdown u-w150px u-w100px--xs use-btn-primary-height {{hasUnits}} dw-mod"> 468 <label class="dropdown__header dropdown__btn dw-mod" for="UnitOptions_{{id}}">{{unitName}}</label> 469 <div id="unitOptions" class="dropdown__content dw-mod"> 470 {{#unitOptions}} 471 {{>UnitOption}} 472 {{/unitOptions}} 473 </div> 474 <label class="dropdown-trigger-off" for="UnitOptions_{{id}}"></label> 475 </div> 476 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 477 </div> 478 } 479 else if (showViewButton) 480 { 481 <div class="buttons-collection buttons-collection--right"> 482 <a href="{{link}}" id="CartButton_{{id}}" title="@Translate(viewMoreText)" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" class="btn btn--secondary btn--full u-no-margin dw-mod"> 483 @Translate(viewMoreText) 484 </a> 485 </div> 486 } 487 </div> 488 </div> 489 </div> 490 } 491 else 492 { 493 <button type="button" id="CartButton_{{id}}" class="u-hidden"></button> 494 } 495 496 @if (showAddToDownloadButton && Pageview.User != null) 497 { 498 <div class="grid__cell-footer @((showCartButton || showViewButton) ? "u-margin-top" : "" )"> 499 <div class="grid__cell"> 500 <button type="button" class="btn btn--primary btn--condensed u-no-margin u-pull--right dw-mod js-add-to-downloads" title="@Translate("Add")" data-product-id="{{productId}}"> 501 <i class="fas fa-plus js-button-icon"></i> 502 <span class="js-button-text">@Translate("Add")</span> 503 </button> 504 </div> 505 </div> 506 } 507 </div> 508 </div> 509 {{/.}} 510 </script> 511 } 512 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 513 @using Dynamicweb.Core 514 @using System 515 @using System.Web 516 @using System.Collections.Generic 517 @using Dynamicweb.Rapido.Blocks 518 519 @if (Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableGridView")) 520 { 521 BlocksPage productList = BlocksPage.GetBlockPage("ProductList"); 522 523 Block gridViewButton = new Block 524 { 525 Id = "ProductGridItemContainer", 526 Name = "th", 527 SortId = 20 528 }; 529 productList.Add("Views", gridViewButton); 530 531 Block gridViewScripts = new Block 532 { 533 Id = "GridViewScripts", 534 SortId = 20, 535 Template = GridView() 536 }; 537 productList.Add("BottomSnippets", gridViewScripts); 538 } 539 540 @helper GridView() 541 { 542 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 543 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 544 bool showPrice = !Pageview.AreaSettings.GetItem("ProductList").GetBoolean("HidePrice"); 545 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 546 string columnsCount = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetList("Columns") != null ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetList("Columns").SelectedValue : "4"; 547 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToCartButton"); 548 bool showViewButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowViewButton"); 549 bool showFavoriteButton = !Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HideFavoriteButton"); 550 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToDownloadButton"); 551 bool showStock = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowStockAndShipping"); 552 bool showNumber = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowProductNumber"); 553 bool showStaticVariants = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowStaticVariants"); 554 string cartButtonText = Dynamicweb.Core.Converter.ToInt32(columnsCount) >= 4 && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" ? Translate("Add to cart") : ""; 555 string viewMoreText = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("ViewMoreText")) ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("ViewMoreText") : "View"; 556 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 557 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 558 bool isPricesWithVATEnabled = Dynamicweb.Core.Converter.ToBoolean(Pageview.Area.EcomPricesWithVat); 559 string imageZoomOnHover = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HoverImageZoom") ? "image-hover--zoom" : ""; 560 bool secondaryImage = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("HoverAlternatineImage") != null ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HoverAlternatineImage") : false; 561 string footerClasses = showStaticVariants ? "u-min-h120px" : ""; 562 563 564 <script id="ProductGridItemContainer" type="text/x-template"> 565 {{#.}} 566 <div id="Product{{id}}" data-template="ProductGridItem" data-preloader="overlay" class="grid__col-lg-@columnsCount grid__col-md-@columnsCount grid__col-sm-@columnsCount grid__col-xs-6 product-list__grid-item @imageZoomOnHover dw-mod"> 567 {{#Product}} 568 {{>ProductGridItem}} 569 {{/Product}} 570 </div> 571 {{/.}} 572 </script> 573 574 <script id="ProductGridItem" type="text/x-template"> 575 {{#.}} 576 @if (useGoogleTagManager) 577 { 578 <text>{{{googleEnchantImpression 'Product catalogue' currency googleImpression}}}</text> 579 } 580 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 581 <input type="hidden" name="ProductID{{id}}" value="{{productId}}" /> 582 583 <div class="grid__cell product-list__grid-item__image dw-mod {{noImage}}"> 584 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{name}}" class="u-block u-position-relative image-hover__wrapper dw-mod"> 585 <img class="grid__cell-img grid__cell-img--centered u-padding b-lazy" src="/Files/Images/placeholder.gif" 586 data-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;FillCanvas=true&amp;DoNotUpscale=true&amp;image={{image}}" 587 @if (secondaryImage) { 588 <text> 589 {{#if secondaryImage}} 590 data-secondary-image-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;FillCanvas=true&amp;DoNotUpscale=true&amp;image={{secondaryImage}}" 591 {{/if}} 592 </text> 593 } 594 alt="{{name}}" /> 595 {{#StickersContainers}} 596 {{>StickersContainer}} 597 {{/StickersContainers}} 598 </a> 599 @if (showFavoriteButton) 600 { 601 <div class="favorites favorites--for-grid-view u-pull--right {{hasVariants}} dw-mod" {{hasVariants}}> 602 {{#Favorite}} 603 {{>FavoriteTemplate}} 604 {{/Favorite}} 605 </div> 606 } 607 </div> 608 609 <div class="grid__cell product-list__grid-item__price-info {{shortGridInfo}} dw-mod"> 610 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{name}}"> 611 <h6 class="u-condensed-text">{{name}}</h6> 612 </a> 613 @if (showNumber) 614 { 615 <div class="item-number dw-mod">{{number}}</div> 616 } 617 618 @if (showPrice && !onlyPreview) 619 { 620 if (pointShopOnly) 621 { 622 <text> 623 {{#if havePointPrice}} 624 <div class="price price--product-list dw-mod">{{points}} @Translate("points")</div> 625 {{else}} 626 @Translate("Not available") 627 {{/if}} 628 </text> 629 } 630 else 631 { 632 <div class="price price--product-list dw-mod">{{price}}</div> 633 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 634 if (showVATPrice) 635 { 636 <div class="vat-price vat-price--product-list u-margin-top dw-mod"> 637 @if (isPricesWithVATEnabled) 638 { 639 <span>@Translate("excl. VAT")</span><span> ({{priceWithoutVAT}})</span> 640 } 641 else 642 { 643 <span>@Translate("incl. VAT")</span><span> ({{priceWithVAT}})</span> 644 } 645 </div> 646 } 647 } 648 } 649 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 650 <input type="hidden" value="{{variantid}}" name="VariantID{{id}}" id="Variant_{{id}}" /> 651 </div> 652 653 <div class="product-list__grid-item__footer @footerClasses dw-mod"> 654 @if (!onlyPreview && showCartButton) 655 { 656 <div class="u-ta-center u-inline-block"> 657 <div class="buttons-collection {{hideBuyOptions}}"> 658 @if (pointShopOnly) 659 { 660 <button type="button" id="CartButton_{{id}}" class="btn btn--primary btn--condensed u-no-margin dw-mod js-cart-btn {{disabledBuyButton}} {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 661 onclick="Cart.AddToCart(event, { 662 id: {{productId}}', 663 variantId: '{{variantid}}', 664 unitId: '{{unitId}}', 665 quantity: 1, 666 buyForPoints: true, 667 productInfo: {{productInfo}} 668 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 669 <i class="@cartIcon"></i><span class="u-hidden-xs u-hidden-xxs"> @Translate("Buy with points")</span> 670 </button> 671 } 672 else 673 { 674 <button type="button" id="CartButton_{{id}}" class="js-cart-btn btn btn--primary btn--condensed u-no-margin u-pull--right dw-mod {{disabledBuyButton}}" name="submit" 675 onclick="Cart.AddToCart(event, { 676 id: '{{productId}}', 677 variantId: '{{variantid}}', 678 unitId: '{{unitId}}', 679 quantity: document.getElementById('Quantity_{{id}}').value, 680 productInfo: {{productInfo}} 681 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 682 <i class="@cartIcon"></i><span class="u-hidden-xs u-hidden-xxs"> @cartButtonText</span> 683 </button> 684 <input type="number" class="u-w80px u-pull--right use-btn-primary-height" id="Quantity_{{id}}" name="Quantity{{id}}" value="1" min="1"> 685 } 686 </div> 687 </div> 688 if (showViewButton) 689 { 690 <div class="u-ta-center {{hideViewMore}}"> 691 <a href="{{link}}" id="CartButton_{{id}}" class="btn btn--secondary btn--full u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(viewMoreText)">@Translate(viewMoreText)</a> 692 </div> 693 } 694 695 } 696 else if (showViewButton) 697 { 698 <div class="u-ta-center"> 699 <a href="{{link}}" id="CartButton_{{id}}" class="btn btn--secondary btn--full u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(viewMoreText)">@Translate(viewMoreText)</a> 700 </div> 701 } 702 703 @if (!onlyPreview && showStock) 704 { 705 <div class="u-margin-top"> 706 <div><span class="stock-icon {{stockState}} u-no-margin dw-mod" title="{{stockText}}"></span> {{stockText}}</div> 707 <div> 708 {{#if deliveryText}} 709 {{deliveryText}} 710 {{else}} 711 - 712 {{/if}} 713 </div> 714 </div> 715 } 716 717 @if (showStaticVariants) { 718 <text> 719 {{#Variants}} 720 {{>StaticVariantsTemplate}} 721 {{/Variants}} 722 723 {{#ifCond variantGroupsCount '>' 1}} 724 <div class="static-variant"> 725 @Translate("More options available") 726 </div> 727 {{/ifCond}} 728 729 {{#ifCond variantGroupsCount '==' 0}} 730 <div class="static-variant"></div> 731 {{/ifCond}} 732 </text> 733 } 734 735 @if (showAddToDownloadButton && Pageview.User != null) 736 { 737 <button type="button" class="btn btn--primary u-no-margin u-margin-top btn--condensed dw-mod js-add-to-downloads" title="@Translate("Add")" data-product-id="{{productId}}"> 738 <i class="fas fa-plus js-button-icon"></i> 739 <span class="js-button-text">@Translate("Add")</span> 740 </button> 741 } 742 </div> 743 {{/.}} 744 </script> 745 } 746 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 747 @using Dynamicweb.Core 748 @using System 749 @using System.Web 750 @using System.Collections.Generic 751 @using Dynamicweb.Rapido.Blocks 752 753 @if (Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableDetailsView")) 754 { 755 BlocksPage productList = BlocksPage.GetBlockPage("ProductList"); 756 757 Block detailsViewButton = new Block 758 { 759 Id = "ProductDetailsItemContainer", 760 Name = "list", 761 SortId = 30 762 }; 763 productList.Add("Views", detailsViewButton); 764 765 Block detailsViewScripts = new Block 766 { 767 Id = "DetailsViewScripts", 768 SortId = 30, 769 Template = DetailsView() 770 }; 771 productList.Add("BottomSnippets", detailsViewScripts); 772 } 773 774 @helper DetailsView() 775 { 776 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 777 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 778 bool showPrice = !Pageview.AreaSettings.GetItem("ProductList").GetBoolean("HidePrice"); 779 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 780 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowAddToCartButton"); 781 bool showViewButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowViewButton"); 782 bool showFavoriteButton = !Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("HideFavoriteButton"); 783 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowAddToDownloadButton"); 784 bool showStock = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowStockAndShipping"); 785 bool showImage = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowImage"); 786 bool showNumber = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowProductNumber"); 787 bool showStaticVariants = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowStaticVariants"); 788 string viewMoreText = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetString("ViewMoreText")) ? Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetString("ViewMoreText") : "View"; 789 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 790 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 791 bool isPricesWithVATEnabled = Dynamicweb.Core.Converter.ToBoolean(Pageview.Area.EcomPricesWithVat); 792 793 <script id="ProductDetailsItemContainer" type="text/x-template"> 794 {{#.}} 795 <div id="Product{{id}}" data-template="ProductDetailsItem" data-preloader="overlay" class="grid__col-12 u-no-padding-y" style="z-index: {{zIndex}}"> 796 {{#Product}} 797 {{>ProductDetailsItem}} 798 {{/Product}} 799 </div> 800 {{/.}} 801 </script> 802 803 if (Pageview.Device.ToString() != "Mobile") 804 { 805 <script id="ProductDetailsItem" type="text/x-template"> 806 {{#.}} 807 @if (useGoogleTagManager) 808 { 809 <text>{{{googleEnchantImpression 'Product catalogue' currency googleImpression}}}</text> 810 } 811 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 812 <input type="hidden" name="ProductID{{id}}" value="{{productId}}" /> 813 <div class="product-list__details-item grid__col-12 dw-mod"> 814 <div class="product-list__details-item__left grid__cell dw-mod"> 815 @if (showImage) 816 { 817 <div class="lightbox u-hidden-xxs"> 818 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{name}}"> 819 <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}}" /> 820 <div class="u-margin-right {{noImage}}"> 821 <img class="b-lazy" src="/Files/Images/placeholder.gif" 822 data-src="/Admin/Public/GetImage.ashx?width=75&amp;height=55&amp;crop=5&FillCanvas=true&amp;Compression=75&amp;image={{image}}" 823 alt="{{name}}" /> 824 </div> 825 </a> 826 </div> 827 } 828 <div class="u-margin-left u-margin-right"> 829 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{name}}"> 830 <h6 class="u-no-margin">{{name}}</h6> 831 </a> 832 <div class="item-number item-number--compressed dw-mod"> 833 @if (showNumber) 834 { 835 <div class="item-number dw-mod">{{number}}</div> 836 } 837 838 @if (!onlyPreview && showStock) 839 { 840 <span> 841 <span class="stock-icon {{stockState}} u-no-margin dw-mod" title="{{stockText}}"></span> 842 <span class="u-margin-right--lg"> {{stockText}}</span> 843 {{deliveryText}} 844 </span> 845 } 846 </div> 847 @if (showStaticVariants) 848 { 849 <span> 850 {{#Variants}} 851 {{>StaticVariantsTemplate}} 852 {{/Variants}} 853 </span> 854 <text> 855 {{#ifCond variantGroupsCount '>' 1}} 856 <div class="static-variant"> 857 @Translate("More options available") 858 </div> 859 {{/ifCond}} 860 </text> 861 } 862 <div class="grid__cell-footer stickers-container stickers-container--row u-margin-top dw-mod"> 863 {{#StickersContainers}} 864 {{#Stickers}} 865 {{>MiniSticker}} 866 {{/Stickers}} 867 {{/StickersContainers}} 868 </div> 869 </div> 870 </div> 871 <div class="product-list__details-item__right grid__cell dw-mod"> 872 @if (!onlyPreview && showCartButton) 873 { 874 <div class="u-margin-right"> 875 <input type="checkbox" id="UnitOptions_{{id}}" class="dropdown-trigger" /> 876 <div class="dropdown u-w120px use-btn-primary-height {{hasUnits}} dw-mod"> 877 <label class="dropdown__header dropdown__btn dw-mod" for="UnitOptions_{{id}}">{{unitName}}</label> 878 <div id="unitOptions" class="dropdown__content dw-mod"> 879 {{#unitOptions}} 880 {{>UnitOption}} 881 {{/unitOptions}} 882 </div> 883 <label class="dropdown-trigger-off" for="UnitOptions_{{id}}"></label> 884 </div> 885 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 886 <input type="hidden" value="{{variantid}}" name="VariantID{{id}}" id="Variant_{{id}}" /> 887 </div> 888 } 889 890 <div class="u-min-w140px product-list__details-item-price-block"> 891 <div class="u-ta-right u-padding-right"> 892 @if (pointShopOnly) 893 { 894 <text> 895 {{#if havePointPrice}} 896 <div class="price price--product-list price--micro dw-mod">{{points}} @Translate("points")</div> 897 {{else}} 898 @Translate("Not available") 899 {{/if}} 900 </text> 901 } 902 else 903 { 904 <div class="before-price {{onSale}} before-price--micro dw-mod">{{discount}}</div> 905 <div class="price price--product-list price--micro dw-mod">{{price}}</div> 906 if (showVATPrice) 907 { 908 <small class="vat-price vat-price--micro dw-mod"> 909 @if (isPricesWithVATEnabled) 910 { 911 @Translate("excl. VAT") <text>({{priceWithoutVAT}})</text> 912 } 913 else 914 { 915 @Translate("incl. VAT") <text>({{priceWithVAT}})</text> 916 } 917 </small> 918 } 919 } 920 </div> 921 </div> 922 923 @if (!onlyPreview && showCartButton) 924 { 925 if (!pointShopOnly) 926 { 927 <div class="{{hideBuyOptions}}"> 928 <input type="number" class="u-w100px u-no-margin u-margin-right use-btn-primary-height" id="Quantity_{{id}}" name="Quantity{{id}}" value="1" min="1"> 929 </div> 930 } 931 <div class="{{hideBuyOptions}}"> 932 @if (pointShopOnly) 933 { 934 <button type="button" id="CartButton_{{id}}" class="btn btn--primary btn--condensed u-no-margin dw-mod js-cart-btn {{disabledBuyButton}} {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 935 onclick="Cart.AddToCart(event, { 936 id: '{{productId}}', 937 variantId: '{{variantId}}', 938 unitId: '{{UnitId}}', 939 quantity: 1, 940 buyForPoints: true, 941 productInfo: {{productInfo}} 942 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 943 <i class="@cartIcon"></i><span> @Translate("Buy with points")</span> 944 </button> 945 } 946 else 947 { 948 <button type="button" id="CartButton_{{id}}" class="js-cart-btn btn btn--primary btn--condensed u-pull--right u-no-margin dw-mod {{disabledBuyButton}}" name="submit" 949 onclick="Cart.AddToCart(event, { 950 id: '{{productId}}', 951 variantId: '{{variantid}}', 952 unitId: '{{unitId}}', 953 quantity: document.getElementById('Quantity_{{id}}').value, 954 productInfo: {{productInfo}} 955 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 956 <i class="@cartIcon"></i> 957 </button> 958 } 959 </div> 960 if (showViewButton) 961 { 962 <text> 963 {{#unless hideViewMore}} 964 <div> 965 <a href="{{link}}" class="btn btn--secondary u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(viewMoreText)">@Translate(viewMoreText)</a> 966 </div> 967 {{/unless}} 968 </text> 969 } 970 } 971 else if (showViewButton) 972 { 973 <div> 974 <a href="{{link}}" class="btn btn--secondary u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(viewMoreText)">@Translate(viewMoreText)</a> 975 </div> 976 } 977 @if (showFavoriteButton && Pageview.User != null) 978 { 979 <div class="favorites u-margin {{hasVariants}} dw-mod" {{hasVariants}}> 980 {{#Favorite}} 981 {{>FavoriteTemplate}} 982 {{/Favorite}} 983 </div> 984 <div class="favorites favorites--lg u-hidden {{hasVariants}} dw-mod" {{hasVariants}}> 985 {{#Favorite}} 986 {{>FavoriteListItem}} 987 {{/Favorite}} 988 </div> 989 } 990 @if (showAddToDownloadButton && Pageview.User != null) 991 { 992 <button type="button" class="btn btn--primary u-no-margin btn--condensed u-margin-left u-margin-right dw-mod js-add-to-downloads" title="@Translate(" Add")" data-product-id="{{productId}}"> 993 <i class="fas fa-plus js-button-icon"></i> 994 </button> 995 } 996 </div> 997 </div> 998 {{/.}} 999 </script> 1000 } else { 1001 <script id="ProductDetailsItem" type="text/x-template"> 1002 {{#.}} 1003 @if (useGoogleTagManager) 1004 { 1005 <text>{{{googleEnchantImpression 'Product catalogue' currency googleImpression}}}</text> 1006 } 1007 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 1008 <input type="hidden" name="ProductID{{id}}" value="{{productId}}" /> 1009 <div class="grid__col-12 dw-mod"> 1010 <div class="grid__cell u-color-light--bg dw-mod"> 1011 <div class="u-margin"> 1012 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{name}}"> 1013 <h6 class="u-no-margin">{{name}}</h6> 1014 </a> 1015 <div class="item-number item-number--compressed dw-mod"> 1016 @if (showNumber) 1017 { 1018 <div class="item-number dw-mod">{{number}}</div> 1019 } 1020 1021 @if (!onlyPreview && showStock) 1022 { 1023 <span> 1024 <span class="stock-icon {{stockState}} u-no-margin dw-mod" title="{{stockText}}"></span> 1025 <span> {{stockText}}</span> 1026 {{deliveryText}} 1027 </span> 1028 } 1029 </div> 1030 @if (showStaticVariants) 1031 { 1032 <span> 1033 {{#Variants}} 1034 {{>StaticVariantsTemplate}} 1035 {{/Variants}} 1036 </span> 1037 <text> 1038 {{#ifCond variantGroupsCount '>' 1}} 1039 <div class="static-variant"> 1040 @Translate("More options available") 1041 </div> 1042 {{/ifCond}} 1043 </text> 1044 } 1045 <div class="grid__cell-footer stickers-container stickers-container--row u-margin-top dw-mod"> 1046 {{#StickersContainers}} 1047 {{#Stickers}} 1048 {{>MiniSticker}} 1049 {{/Stickers}} 1050 {{/StickersContainers}} 1051 </div> 1052 </div> 1053 <div class="u-ta-right u-margin-bottom product-list__details-item-price-block dw-mod"> 1054 @if (pointShopOnly) 1055 { 1056 <text> 1057 {{#if havePointPrice}} 1058 <div class="price price--product-list price--micro dw-mod">{{points}} @Translate("points")</div> 1059 {{else}} 1060 @Translate("Not available") 1061 {{/if}} 1062 </text> 1063 } 1064 else 1065 { 1066 <div class="before-price {{onSale}} before-price--micro dw-mod">{{discount}}</div> 1067 <div class="price price--product-list price--micro dw-mod">{{price}}</div> 1068 } 1069 </div> 1070 </div> 1071 <div class="grid__cell u-color-light--bg dw-mod"> 1072 <div class="collection u-pull--right u-no-margin u-margin dw-mod"> 1073 @if (!onlyPreview && showCartButton) 1074 { 1075 <div> 1076 <input type="checkbox" id="UnitOptions_{{id}}" class="dropdown-trigger" /> 1077 <div class="dropdown u-w120px use-btn-primary-height {{hasUnits}} dw-mod"> 1078 <label class="dropdown__header dropdown__btn dw-mod" for="UnitOptions_{{id}}">{{unitName}}</label> 1079 <div id="unitOptions" class="dropdown__content dw-mod"> 1080 {{#unitOptions}} 1081 {{>UnitOption}} 1082 {{/unitOptions}} 1083 </div> 1084 <label class="dropdown-trigger-off" for="UnitOptions_{{id}}"></label> 1085 </div> 1086 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 1087 <input type="hidden" value="{{variantid}}" name="VariantID{{id}}" id="Variant_{{id}}" /> 1088 </div> 1089 } 1090 1091 @if (!onlyPreview && showCartButton) 1092 { 1093 if (!pointShopOnly) 1094 { 1095 <div class="{{hideBuyOptions}}"> 1096 <input type="number" class="u-w50px u-no-margin use-btn-primary-height" id="Quantity_{{id}}" name="Quantity{{id}}" value="1" min="1"> 1097 </div> 1098 } 1099 <div class="{{hideBuyOptions}}"> 1100 @if (pointShopOnly) 1101 { 1102 <button type="button" id="CartButton_{{id}}" class="btn btn--primary btn--condensed u-no-margin dw-mod js-cart-btn {{disabledBuyButton}} {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 1103 onclick="Cart.AddToCart(event, { 1104 id: '{{productId}}', 1105 variantId: '{{variantId}}', 1106 unitId: '{{UnitId}}', 1107 quantity: 1, 1108 buyForPoints: true, 1109 productInfo: {{productInfo}} 1110 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 1111 <i class="@cartIcon"></i><span> @Translate("Buy with points")</span> 1112 </button> 1113 } 1114 else 1115 { 1116 <button type="button" id="CartButton_{{id}}" class="js-cart-btn btn btn--primary btn--condensed u-pull--right u-no-margin dw-mod {{disabledBuyButton}}" name="submit" 1117 onclick="Cart.AddToCart(event, { 1118 id: '{{productId}}', 1119 variantId: '{{variantid}}', 1120 unitId: '{{unitId}}', 1121 quantity: document.getElementById('Quantity_{{id}}').value, 1122 productInfo: {{productInfo}} 1123 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 1124 <i class="@cartIcon"></i> 1125 </button> 1126 } 1127 </div> 1128 if (showViewButton) 1129 { 1130 <text> 1131 {{#unless hideViewMore}} 1132 <div> 1133 <a href="{{link}}" class="btn btn--secondary u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(" View")">@Translate("View")</a> 1134 </div> 1135 {{/unless}} 1136 </text> 1137 } 1138 } 1139 else if (showViewButton) 1140 { 1141 <div> 1142 <a href="{{link}}" class="btn btn--secondary u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(" View")">@Translate("View")</a> 1143 </div> 1144 } 1145 @if (showFavoriteButton && Pageview.User != null) 1146 { 1147 <div class="favorites u-margin {{hasVariants}} dw-mod" {{hasVariants}}> 1148 {{#Favorite}} 1149 {{>FavoriteTemplate}} 1150 {{/Favorite}} 1151 </div> 1152 <div class="favorites favorites--lg u-hidden {{hasVariants}} dw-mod" {{hasVariants}}> 1153 {{#Favorite}} 1154 {{>FavoriteListItem}} 1155 {{/Favorite}} 1156 </div> 1157 } 1158 </div> 1159 </div> 1160 </div> 1161 {{/.}} 1162 </script> 1163 } 1164 } 1165 1166 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1167 @using Dynamicweb.Core 1168 @using System 1169 @using System.Web 1170 @using System.Collections.Generic 1171 @using Dynamicweb.Rapido.Blocks 1172 1173 @{ 1174 BlocksPage productListPromotionsBlocksPage = BlocksPage.GetBlockPage("ProductList"); 1175 1176 Block productListPromotions = new Block 1177 { 1178 Id = "Promotions", 1179 SortId = 10, 1180 Template = RenderProductListPromotions() 1181 }; 1182 productListPromotionsBlocksPage.Add("PageContainer", productListPromotions); 1183 } 1184 1185 @helper RenderProductListPromotions() 1186 { 1187 @*This is part of a script template *@ 1188 1189 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 1190 bool isFavoriteList = !string.IsNullOrEmpty(listId); 1191 1192 if (!isFavoriteList) 1193 { 1194 switch (Pageview.AreaSettings.GetItem("ProductList").GetList("PromotionBlockDesign").SelectedValue) 1195 { 1196 case "OnlyText": 1197 <article class="grid__col-12 u-margin-bottom"> 1198 <h1>{{groupName}}</h1> 1199 {{{groupDescription}}} 1200 </article> 1201 break; 1202 case "TextAndImage": 1203 <article class="grid__col-12 u-margin-bottom"> 1204 <div class="grid grid--bleed"> 1205 <div class="grid__col-md-6"> 1206 <h1>{{groupName}}</h1> 1207 {{{groupDescription}}} 1208 </div> 1209 {{#ifCond groupPromotionImage "!==" ""}} 1210 <div class="grid__col-md-6"> 1211 <img src="/Admin/Public/GetImage.ashx?width=600&crop=5&Compression=75&DoNotUpscale=true&image={{groupPromotionImage}}" alt="{{groupName}}" class="background-image__cover" /> 1212 </div> 1213 {{/ifCond}} 1214 </div> 1215 </article> 1216 break; 1217 case "Banner": 1218 <text> 1219 {{#ifCond groupPromotionImage "!==" ""}} 1220 <article class="grid__col-12 u-margin-bottom"> 1221 <div class="u-color-light grid center-container center-container--with-background-image u-padding" style="background-image:url('{{groupPromotionImage}}'); background-size: cover;"> 1222 <div class="grid__col-12 u-middle"> 1223 <div class="grid__cell"> 1224 {{{groupDescription}}} 1225 </div> 1226 </div> 1227 </div> 1228 </article> 1229 {{/ifCond}} 1230 </text> 1231 break; 1232 } 1233 } 1234 } 1235 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1236 @using Dynamicweb.Core 1237 @using System 1238 @using System.Web 1239 @using System.Collections.Generic 1240 @using Dynamicweb.Rapido.Blocks 1241 1242 @{ 1243 BlocksPage productListMenuBlocksPage = BlocksPage.GetBlockPage("ProductList"); 1244 1245 if (Pageview.Page.PropertyItem["LeftMenu"] != null && Dynamicweb.Core.Converter.ToString(Pageview.Page.PropertyItem["LeftMenu"]) == "True" && Pageview.Page.NavigationSettings != null && Pageview.Page.NavigationSettings.UseEcomGroups) { 1246 Block productListMenuBlock = new Block 1247 { 1248 Id = "Menu", 1249 SortId = 20, 1250 Template = RenderProductListMenu() 1251 }; 1252 1253 productListMenuBlocksPage.Add("Navigation", productListMenuBlock); 1254 } 1255 } 1256 1257 @helper RenderProductListMenu() 1258 { 1259 var navigationMarkup = RenderNavigation(new 1260 { 1261 id = "leftnav", 1262 cssclass = "dwnavigation", 1263 startLevel = 1, 1264 endlevel = 5, 1265 template = "LeftNavigation.xslt", 1266 mode = "ecom" 1267 }); 1268 1269 <h2 class="u-margin-bottom">@Translate("Product categories")</h2> 1270 1271 <div class="u-padding-bottom--lg"> 1272 @navigationMarkup 1273 </div> 1274 } 1275 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1276 @using Dynamicweb.Core 1277 @using System 1278 @using System.Web 1279 @using System.Collections.Generic 1280 @using Dynamicweb.Rapido.Blocks 1281 1282 @{ 1283 BlocksPage productListFacetsBlocksPage = BlocksPage.GetBlockPage("ProductList"); 1284 1285 string facetsBlockViewMode = !String.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode")) ? Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode").ToLower() : "left"; 1286 1287 if (facetsBlockViewMode == "left" && Pageview.Device.ToString() != "Mobile") 1288 { 1289 Block facetsBlock = new Block 1290 { 1291 Id = "Facets", 1292 SortId = 30, 1293 Template = RenderProductListFacets() 1294 }; 1295 productListFacetsBlocksPage.Add("Navigation", facetsBlock); 1296 } 1297 1298 if (facetsBlockViewMode == "top" || Pageview.Device.ToString() == "Mobile") 1299 { 1300 Block facetsBlock = new Block 1301 { 1302 Id = "Facets", 1303 SortId = 10, 1304 Template = RenderProductListTopFacets() 1305 }; 1306 productListFacetsBlocksPage.Add("ProductList", facetsBlock); 1307 } 1308 1309 1310 Block facetSelections = new Block 1311 { 1312 Id = "FacetSelections", 1313 SortId = 20, 1314 Template = RenderFacetSelections() 1315 }; 1316 productListFacetsBlocksPage.Add("ProductList", facetSelections); 1317 } 1318 1319 @helper RenderFacetSelections() 1320 { 1321 @*This is part of a script template *@ 1322 <div class="grid"> 1323 <div class="grid__col-12 grid__col--bleed"> 1324 <div class="collection u-no-margin" id="selectedFacets"> 1325 {{#FacetSelections}} 1326 {{> (lookup . 'template') }} 1327 {{/FacetSelections}} 1328 </div> 1329 </div> 1330 </div> 1331 } 1332 1333 @helper RenderProductListFacets() 1334 { 1335 @*This is part of a script template *@ 1336 <div class="u-margin-bottom--lg"> 1337 <h2 class="u-no-margin">@Translate("Filters")</h2> 1338 </div> 1339 1340 <input type="checkbox" id="CheckFacetGroups" class="js-remember-state u-hidden" data-expand="CheckFacetGroups" /> 1341 <div class="facets-container facets-container--left expandable--collapsed dw-mod" data-trigger="CheckFacetGroups"> 1342 {{#FacetGroups}} 1343 <input type="checkbox" id="OptionsGroup_{{name}}" class="expand-trigger js-remember-state" {{defaultState}} /> 1344 1345 <div class="expand-container facets-container__box dw-mod js-filter"> 1346 <label class="expand-container__btn facets-container__header dw-mod" for="OptionsGroup_{{name}}">{{name}}</label> 1347 <div class="expand-container__content dw-mod"> 1348 <div class="u-margin {{showFilter}}"> 1349 <input type="text" class="u-full-width u-no-margin" onkeyup="Filter.FilterItems(event)" placeholder="@Translate("Search")" /> 1350 </div> 1351 <div class="facets-container__list dw-mod"> 1352 {{#FacetOptions}} 1353 {{#ifCond template "===" "Checkboxes"}} 1354 {{>Checkboxes}} 1355 {{/ifCond}} 1356 {{#ifCond template "===" "Range"}} 1357 {{>Checkboxes}} 1358 {{/ifCond}} 1359 {{#ifCond template "===" "Weight"}} 1360 {{>Checkboxes}} 1361 {{/ifCond}} 1362 {{#ifCond template "===" "Tags"}} 1363 {{>Tags}} 1364 {{/ifCond}} 1365 {{#ifCond template "===" "Colors"}} 1366 {{>Colors}} 1367 {{/ifCond}} 1368 {{/FacetOptions}} 1369 </div> 1370 </div> 1371 </div> 1372 {{/FacetGroups}} 1373 </div> 1374 <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod js-expand-hide facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Select filters")</label> 1375 <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod expandable--collapsed facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Close filters")</label> 1376 } 1377 1378 @helper RenderProductListTopFacets() 1379 { 1380 @*This is part of a script template *@ 1381 <input type="checkbox" id="CheckFacetGroups" class="js-remember-state u-hidden" data-expand="CheckFacetGroups" /> 1382 <div class="grid grid--external-bleed-x dw-mod expandable--collapsed facets-container facets-container--top" data-trigger="CheckFacetGroups"> 1383 {{#FacetGroups}} 1384 <div class="grid__col-lg-3 grid__col-md-3 grid__col-sm-4 grid__col-xs-12"> 1385 <input type="checkbox" id="OptionsGroup_{{counter}}" class="dropdown-trigger" /> 1386 <div class="dropdown dw-mod js-filter"> 1387 <label class="dropdown__header dropdown__btn dw-mod" for="OptionsGroup_{{counter}}">{{name}}</label> 1388 <div class="dropdown__content dropdown__content--padding dw-mod"> 1389 <div class="u-margin-bottom {{showFilter}}"> 1390 <input type="text" class="u-full-width u-no-margin" onkeyup="Filter.FilterItems(event)" placeholder="@Translate("Search")" /> 1391 </div> 1392 {{#FacetOptions}} 1393 {{#ifCond template "===" "Checkboxes"}} 1394 {{>Checkboxes}} 1395 {{/ifCond}} 1396 {{#ifCond template "===" "Range"}} 1397 {{>Checkboxes}} 1398 {{/ifCond}} 1399 {{#ifCond template "===" "Weight"}} 1400 {{>Checkboxes}} 1401 {{/ifCond}} 1402 {{#ifCond template "===" "Tags"}} 1403 {{>Tags}} 1404 {{/ifCond}} 1405 {{#ifCond template "===" "Colors"}} 1406 {{>Colors}} 1407 {{/ifCond}} 1408 {{/FacetOptions}} 1409 </div> 1410 <label class="dropdown-trigger-off" for="OptionsGroup_{{counter}}"></label> 1411 </div> 1412 </div> 1413 {{/FacetGroups}} 1414 </div> 1415 <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod js-expand-hide facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Select filters")</label> 1416 <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod expandable--collapsed facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Close filters")</label> 1417 } 1418 1419 @*Facets*@ 1420 <script id="Checkboxes" type="text/x-template"> 1421 <input type="checkbox" class="{{selected}} checkbox-facet__checkbox form__control dw-mod" onclick="Facets.UpdateFacets(this);" id="{{queryParameter}}{{value}}" name="{{queryParameter}}" value="[{{value}}]" {{selected}} {{disabled}}> 1422 <label class="{{disabled}} checkbox-facet dw-mod" data-filter-value="{{label}}" for="{{queryParameter}}{{value}}"> 1423 <span class="checkbox-facet__label dw-mod">{{label}}</span> 1424 <span class="checkbox-facet__count dw-mod">({{count}})</span> 1425 </label> 1426 </script> 1427 1428 <script id="Tags" type="text/x-template"> 1429 <button type="button" class="btn btn--tag {{selected}} {{disabled}}" data-filter-value="{{label}}" data-check="{{selected}}" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="[{{value}}]" {{disabled}}> 1430 {{label}} <span class="facets-group__counter">({{count}})</span> 1431 </button> 1432 </script> 1433 1434 <script id="Colors" type="text/x-template"> 1435 <button type="button" class="btn btn--colorbox u-margin-right {{selected}} {{disabled}}" data-filter-value="{{label}}" style="background-color: {{value}}" title="{{label}}" data-check="{{selected}}" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="[{{value}}]" {{disabled}}></button> 1436 </script> 1437 1438 @*Facet selections*@ 1439 <script id="SelectedFilter" type="text/x-template"> 1440 <button type="button" class="btn btn--tag" data-check="checked" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="[{{value}}]" title="@Translate("Remove filter")"> 1441 {{group}}: {{label}} <i class="fas fa-times"></i> 1442 </button> 1443 </script> 1444 1445 <script id="SelectedColorFilter" type="text/x-template"> 1446 <button type="button" class="btn btn--tag" data-check="checked" onclick="Facets.UpdateFacets(this);" name="{{queryParameter}}" value="[{{value}}]" title="@Translate("Remove filter")"> 1447 {{group}}: <div class="btn__colorbox" style="background-color: {{label}}"></div> <i class="fas fa-times"></i> 1448 </button> 1449 </script> 1450 1451 <script id="ResetFilters" type="text/x-template"> 1452 <button type="button" class="btn btn--tag" onclick="Facets.ResetFacets();"> 1453 @Translate("Reset all filters") <i class="fas fa-redo"></i> 1454 </button> 1455 </script> 1456 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1457 @using Dynamicweb.Core 1458 @using System 1459 @using System.Web 1460 @using System.Collections.Generic 1461 @using Dynamicweb.Rapido.Blocks 1462 1463 @{ 1464 BlocksPage productListMoreBlocksPage = BlocksPage.GetBlockPage("ProductList"); 1465 1466 Block moreBlock = new Block 1467 { 1468 Id = "More", 1469 SortId = 40, 1470 Template = RenderListMore() 1471 }; 1472 1473 productListMoreBlocksPage.Add("ProductList", moreBlock); 1474 } 1475 1476 @helper RenderListMore() 1477 { 1478 @*This is part of a script template *@ 1479 string groupID = HttpContext.Current.Request.QueryString.Get("groupid"); 1480 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 1481 bool isFavoriteList = !string.IsNullOrEmpty(listId); 1482 string moreFeedFullUrl = GetGlobalValue("Global:Pageview.Url.Raw") + "&feed=true"; 1483 moreFeedFullUrl += !isFavoriteList ? "&DoNotShowVariantsAsSingleProducts=True" : ""; 1484 string columnCss = Pageview.Device.ToString() == "Mobile" ? "grid__col--bleed" : "grid__col--bleed-y"; 1485 1486 <div class="grid"> 1487 <div class="grid__col-12 @columnCss"> 1488 <button type="button" id="LoadMoreButton" 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="@moreFeedFullUrl&groupid=@groupID{{loadMoreFeedParams}}" onclick="LoadMore.Next(this)" {{nextdisabled}}>@Translate("Load") {{pageSizeText}} @Translate("more")</button> 1489 <button type="button" class="btn btn--clean" onclick="window.scroll(0, 0)">@Translate("Return to top")</button> 1490 </div> 1491 </div> 1492 } 1493 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1494 @using Dynamicweb.Core 1495 @using System 1496 @using System.Web 1497 @using System.Collections.Generic 1498 @using Dynamicweb.Rapido.Blocks 1499 1500 @{ 1501 BlocksPage productListBottomSnippetsPage = BlocksPage.GetBlockPage("ProductList"); 1502 1503 Block productListStickers = new Block 1504 { 1505 Id = "Stickers", 1506 SortId = 10, 1507 Template = RenderStickersTemplates() 1508 }; 1509 productListBottomSnippetsPage.Add("BottomSnippets", productListStickers); 1510 1511 Block productListUnits = new Block 1512 { 1513 Id = "Units", 1514 SortId = 20, 1515 Template = RenderUnitTemplates() 1516 }; 1517 productListBottomSnippetsPage.Add("BottomSnippets", productListUnits); 1518 1519 Block productListVariants = new Block 1520 { 1521 Id = "Variants", 1522 SortId = 30, 1523 Template = RenderVariantTemplates() 1524 }; 1525 productListBottomSnippetsPage.Add("BottomSnippets", productListVariants); 1526 1527 Block productListFavorites = new Block 1528 { 1529 Id = "Favorites", 1530 SortId = 40, 1531 Template = RenderFavoritesTemplates() 1532 }; 1533 productListBottomSnippetsPage.Add("BottomSnippets", productListFavorites); 1534 1535 Block productListPreRender = new Block 1536 { 1537 Id = "PreRenders", 1538 SortId = 50, 1539 Template = RenderPreRenderTemplates() 1540 }; 1541 productListBottomSnippetsPage.Add("BottomSnippets", productListPreRender); 1542 1543 Block productListInitializers = new Block 1544 { 1545 Id = "Initializers", 1546 SortId = 60, 1547 Template = RenderInitializers() 1548 }; 1549 productListBottomSnippetsPage.Add("BottomSnippets", productListInitializers); 1550 } 1551 1552 @helper RenderStickersTemplates() { 1553 <script id="StickersContainer" type="text/x-template"> 1554 <div class="stickers-container stickers-container--{{position}} dw-mod"> 1555 {{#Stickers}} 1556 {{>Sticker}} 1557 {{/Stickers}} 1558 </div> 1559 </script> 1560 1561 <script id="Sticker" type="text/x-template"> 1562 <div class="stickers-container__tag {{className}} dw-mod">{{text}}</div> 1563 </script> 1564 1565 <script id="MiniSticker" type="text/x-template"> 1566 <div class="stickers-container__tag stickers-container__tag--micro {{className}} dw-mod">{{text}}</div> 1567 </script> 1568 } 1569 1570 @helper RenderUnitTemplates() { 1571 <script id="UnitOption" type="text/x-template"> 1572 <div class="dropdown__item dw-mod" onclick="HandlebarsBolt.UpdateContent('Product{{id}}', '{{link}}&feed=true&UnitID={{value}}&rid={{id}}')">{{name}}</div> 1573 </script> 1574 } 1575 1576 @helper RenderVariantTemplates() { 1577 <script id="VariantsTemplate" type="text/x-template"> 1578 {{#.}} 1579 <!--Commented this out to not show variants at the moment--> 1580 <div> 1581 @*<div class="u-bold">{{name}}</div>*@ 1582 <div> 1583 {{#VariantOptions}} 1584 @*{{>VariantOption}}*@ 1585 {{/VariantOptions}} 1586 </div> 1587 </div> 1588 {{/.}} 1589 </script> 1590 1591 <script id="VariantOption" type="text/x-template"> 1592 {{#if color}} 1593 <button type="button" data-variant-id="{{variantId}}" data-variant-group="{{groupId}}" onclick="MatchVariants.SelectThis(event)" class="btn btn--colorbox u-margin-right {{disabled}} {{selected}} js-variant-option" data-check="{{selected}}" {{disabled}} style="background-color: {{color}}"></button> 1594 {{else}} 1595 {{#if image}} 1596 <img data-variant-id="{{variantId}}" data-variant-group="{{groupId}}" src="{{image}}" onclick="MatchVariants.SelectThis(event)" alt="{{name}}" title="{{name}}" class="btn btn--tag {{selected}} js-variant-option" data-check="{{selected}}" /> 1597 {{else}} 1598 <button type="button" data-variant-id="{{variantId}}" data-variant-group="{{groupId}}" onclick="MatchVariants.SelectThis(event)" class="btn btn--tag {{disabled}} {{selected}} js-variant-option" data-check="{{selected}}" {{disabled}}>{{name}}</button> 1599 {{/if}} 1600 {{/if}} 1601 </script> 1602 1603 <script id="StaticVariantsTemplate" type="text/x-template"> 1604 {{#.}} 1605 {{#if isFirstGroup}} 1606 <div> 1607 {{#VariantOptions}} 1608 {{>StaticVariantOption}} 1609 {{/VariantOptions}} 1610 </div> 1611 {{/if}} 1612 {{/.}} 1613 </script> 1614 1615 <script id="StaticVariantOption" type="text/x-template"> 1616 {{#if color}} 1617 <div class="static-variant static-variant--color dw-mod" style="background-color: {{color}}" title="{{name}}"></div> 1618 {{else}} 1619 <div class="static-variant dw-mod">{{name}} </div> 1620 {{/if}} 1621 </script> 1622 1623 <script id="VariantOptionImage" type="text/x-template"> 1624 <img data-variant-id="{{variantId}}" data-friends="{{friendsList}}" data-variant-group="{{groupId}}" onclick="MatchVariants.SelectThis(event)" src="/Admin/Public/GetImage.ashx?width=100&amp;height=50&amp;crop=5&amp;Compression=75&amp;image=/Images/{{image}}" alt="{{name}}" title="{{name}}" class="btn btn--tag {{disabled}} {{selected}} js-variant-option" data-check="{{selected}}" {{disabled}} /> 1625 </script> 1626 } 1627 1628 @helper RenderFavoritesTemplates() { 1629 <script id="FavoriteTemplate" type="text/x-template"> 1630 <div class="favorites-list u-ta-left"> 1631 <label for="FavoriteTrigger_{{id}}" class="u-no-margin js-favorite-btn"><i class="{{favoriteIcon}} fa-1_5x"></i></label> 1632 <input type="checkbox" id="FavoriteTrigger_{{id}}" class="dropdown-trigger" /> 1633 <div class="dropdown dropdown--absolute-position"> 1634 <div class="dropdown__content dropdown__content--show-left dropdown__content--padding u-w220px dw-mod"> 1635 <ul class="list list--clean dw-mod"> 1636 {{#FavoriteLists}} 1637 {{>FavoriteListItem}} 1638 {{/FavoriteLists}} 1639 </ul> 1640 </div> 1641 <label class="dropdown-trigger-off" for="FavoriteTrigger_{{id}}"></label> 1642 </div> 1643 </div> 1644 </script> 1645 1646 <script id="FavoriteListItem" type="text/x-template"> 1647 <li> 1648 <a href="{{link}}" class="list__link u-no-underline dw-mod" onclick="Scroll.SavePosition(event); {{facebookPixelAction}}"><i class="{{favoriteIcon}}"></i> {{name}}</a> 1649 </li> 1650 </script> 1651 } 1652 1653 @helper RenderPreRenderTemplates() { 1654 string facetsViewMode = !String.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode")) ? Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode").ToLower() : "left"; 1655 1656 <script id="ProductPreRenderContainer" type="text/x-template"> 1657 @if (facetsViewMode == "left" && Pageview.Device.ToString() != "Mobile") 1658 { 1659 <div class="grid__col-3"> 1660 <div class="pre-render-element pre-render-element--xs"></div> 1661 <div class="pre-render-element pre-render-element--md"></div> 1662 <div class="pre-render-element pre-render-element--md"></div> 1663 <div class="pre-render-element pre-render-element--md"></div> 1664 </div> 1665 } 1666 <div class="grid__col-auto"> 1667 <div class="pre-render-element pre-render-element--xs"></div> 1668 <div class="pre-render-element pre-render-element--lg"></div> 1669 <div class="pre-render-element pre-render-element--lg"></div> 1670 <div class="pre-render-element pre-render-element--lg"></div> 1671 <div class="pre-render-element pre-render-element--lg"></div> 1672 </div> 1673 </script> 1674 } 1675 1676 @helper RenderInitializers() { 1677 <script> 1678 document.addEventListener("DOMContentLoaded", function (event) { 1679 document.getElementById("productList").addEventListener('contentLoaded', function (e) { 1680 if (getTarget(e).id === "productList") { 1681 Search.Init(); 1682 Facets.Init("selectedFacets", "productList"); 1683 } 1684 }, false); 1685 }); 1686 </script> 1687 } 1688 1689 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1690 @using Dynamicweb.Core 1691 @using System 1692 @using System.Web 1693 @using System.Linq 1694 @using System.Collections.Generic 1695 @using Dynamicweb.Rapido.Blocks 1696 1697 @functions { 1698 BlocksPage productListActionsBlocksPage = BlocksPage.GetBlockPage("ProductList"); 1699 } 1700 1701 @{ 1702 productListActionsBlocksPage.Add("ProductList", new Block 1703 { 1704 Id = "Actions", 1705 SortId = 10, 1706 Template = RenderListActions() 1707 }); 1708 1709 productListActionsBlocksPage.Add("BottomSnippets", new Block() { 1710 Id = "ListViewSelectListener", 1711 Template = RenderListViewSelectListener() 1712 }); 1713 } 1714 1715 @helper RenderListActions() 1716 { 1717 @*This is part of a script template *@ 1718 1719 bool showSorting = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableSorting"); 1720 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 1721 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 1722 bool isFavoriteList = !string.IsNullOrEmpty(listId); 1723 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 1724 1725 List<Block> subBlocks = this.productListActionsBlocksPage.GetBlockListById("Views").OrderBy(item => item.SortId).ToList(); 1726 1727 <div class="grid u-margin-bottom--lg"> 1728 @if (!isFavoriteList) 1729 { 1730 <div class="grid__col--bleed-y grid__col-md-auto u-no-padding-x"> 1731 <h2 class="u-no-margin"><i class="{{headerIcon}}"></i>{{header}}</h2> 1732 </div> 1733 } 1734 <div class="grid--align-end grid__col--bleed-y grid__col-md-auto u-no-padding-x grid--align-self-center"> 1735 <div class="collection u-no-margin"> 1736 @if (showSorting) 1737 { 1738 if (Pageview.Device.ToString() != "Mobile") 1739 { 1740 <h5 class="u-inline-block u-margin-right">@Translate("Sort by")</h5> 1741 } 1742 else 1743 { 1744 <h5 class="u-inline-block u-margin-right">@Translate("Sort")</h5> 1745 } 1746 <input type="checkbox" id="ProductSort" class="dropdown-trigger" /> 1747 <div class="dropdown u-w150px u-w120px--xs u-margin-right u-inline-block dw-mod"> 1748 <label class="dropdown__header dropdown__btn dropdown__btn--small dw-mod" for="ProductSort">{{selectedSort}}</label> 1749 <div class="dropdown__content dw-mod"> 1750 <div class="dropdown__item" onclick="HandlebarsBolt.UpdateQueryParameters('productList', { SortBy: '', SortOrder: '' }, true);">@Translate("Default")</div> 1751 <div class="dropdown__item" onclick="HandlebarsBolt.UpdateQueryParameters('productList', { SortBy: 'Created', SortOrder: 'DESC'}, true);">@Translate("Newest")</div> 1752 @if (!onlyPreview) 1753 { 1754 <div class="dropdown__item" onclick="HandlebarsBolt.UpdateQueryParameters('productList', { SortBy: 'Price', SortOrder: 'ASC' }, true);">@Translate("Price low - high")</div> 1755 <div class="dropdown__item" onclick="HandlebarsBolt.UpdateQueryParameters('productList', { SortBy: 'Price', SortOrder: 'DESC' }, true);">@Translate("Price high - low")</div> 1756 } 1757 </div> 1758 <label class="dropdown-trigger-off" for="ProductSort"></label> 1759 </div> 1760 } 1761 1762 @if (subBlocks.Count > 1) 1763 { 1764 foreach (Block item in subBlocks) 1765 { 1766 <input type="radio" class="tag-btn-trigger" id="ListViewBtn_@item.Id" name="ViewBtnGroup"> 1767 <label for="ListViewBtn_@item.Id" class="btn btn--tag u-no-margin" onclick="HandlebarsBolt.UpdateTemplate('ProductsContainer', '@item.Id')"><i class="fas fa-@item.Name"></i></label> 1768 } 1769 } 1770 1771 @if (isFavoriteList) 1772 { 1773 if (Pageview.Device.ToString() != "Mobile") 1774 { 1775 <button type="submit" class="btn btn--primary btn--sm dw-mod u-no-margin">@Translate("Buy all") <i class="@cartIcon"></i></button> 1776 } 1777 else 1778 { 1779 <button type="submit" class="btn btn--primary btn--full btn--sm u-margin-top dw-mod">@Translate("Buy all") <i class="@cartIcon"></i></button> 1780 } 1781 } 1782 </div> 1783 </div> 1784 </div> 1785 } 1786 1787 @helper RenderListViewSelectListener() 1788 { 1789 /* the same block code placed in ProductListFeed.cshtml */ 1790 Dictionary<string, bool> views = new Dictionary<string, bool>() 1791 { 1792 { "ProductItemContainer", Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableListView") }, 1793 { "ProductGridItemContainer", Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableGridView") }, 1794 { "ProductDetailsItemContainer", Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableDetailsView") } 1795 }; 1796 1797 string defaultView = Pageview.AreaSettings.GetItem("ProductList").GetList("DefaultListView") != null ? Pageview.AreaSettings.GetItem("ProductList").GetList("DefaultListView").SelectedValue : ""; 1798 1799 if (!string.IsNullOrEmpty(defaultView) && views[defaultView]) 1800 { 1801 } 1802 else 1803 { 1804 defaultView = views.FirstOrDefault(x => x.Value).Key ?? "ProductItemContainer"; 1805 } 1806 1807 <script> 1808 let defaultTemplate = '@defaultView'; 1809 let container = 'productList'; 1810 let cookieName = 'ProductsContainerTemplate'; 1811 1812 document.addEventListener('DOMContentLoaded', function (event) { 1813 document.getElementById(container).addEventListener('contentLoaded', function () { 1814 let selectedMode = RememberState.GetCookie(cookieName); 1815 let element = document.getElementById('ListViewBtn_' + (selectedMode != null ? selectedMode : defaultTemplate)); 1816 if (element != null) { 1817 element.checked = true; 1818 } 1819 }, false); 1820 }); 1821 </script> 1822 } 1823 @if (File.Exists(HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Rapido/eCom/ProductList/Blocks/Custom__Blocks.cshtml"))) 1824 { 1825 <text>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1826 @using Dynamicweb.Core 1827 @using System 1828 @using System.Web 1829 @using System.Collections.Generic 1830 @using Dynamicweb.Rapido.Blocks 1831 @using Dynamicweb.Rapido.Blocks.Extensibility 1832 1833 @{ 1834 BlocksPage customBlocksPage = BlocksPage.GetBlockPage("ProductList"); 1835 string facetsBlockViewModeCustom = !String.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode")) ? Pageview.AreaSettings.GetItem("ProductList").GetString("FacetsViewMode").ToLower() : "left"; 1836 1837 1838 if (Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableGridView")) 1839 { 1840 Block customGridViewScripts = new Block 1841 { 1842 Id = "GridViewScripts", 1843 SortId = 20, 1844 Template = CustomGridView() 1845 }; 1846 1847 customBlocksPage.ReplaceBlock(customGridViewScripts); 1848 } 1849 if (Pageview.Page.PropertyItem["LeftMenu"] != null && Dynamicweb.Core.Converter.ToString(Pageview.Page.PropertyItem["LeftMenu"]) == "True" && Pageview.Page.NavigationSettings != null && Pageview.Page.NavigationSettings.UseEcomGroups) 1850 { 1851 Block customProductListMenuBlock = new Block 1852 { 1853 Id = "Menu", 1854 SortId = 20, 1855 Template = CustomRenderProductListMenu() 1856 }; 1857 1858 customBlocksPage.ReplaceBlock(customProductListMenuBlock); 1859 } 1860 1861 1862 if (Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableListView")) 1863 { 1864 Block customListViewScripts = new Block 1865 { 1866 Id = "ListViewScripts", 1867 SortId = 20, 1868 Template = CustomListView() 1869 }; 1870 1871 customBlocksPage.ReplaceBlock(customListViewScripts); 1872 } 1873 1874 if (Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableDetailsView")) 1875 { 1876 Block customDetailsViewScripts = new Block 1877 { 1878 Id = "DetailsViewScripts", 1879 SortId = 30, 1880 Template = CustomDetailsView() 1881 }; 1882 1883 customBlocksPage.ReplaceBlock(customDetailsViewScripts); 1884 } 1885 1886 Block customRenderListActions = new Block 1887 { 1888 Id = "Actions", 1889 SortId = 20, 1890 Template = CustomRenderListActions() 1891 }; 1892 1893 customBlocksPage.ReplaceBlock(customRenderListActions); 1894 1895 Block customProductListStickers = new Block 1896 { 1897 Id = "Stickers", 1898 SortId = 10, 1899 Template = CustomRenderStickersTemplates() 1900 }; 1901 1902 customBlocksPage.ReplaceBlock(customProductListStickers); 1903 1904 if (facetsBlockViewModeCustom == "top" || Pageview.Device.ToString() == "Mobile") 1905 { 1906 Block facetsBlockCustom = new Block 1907 { 1908 Id = "Facets", 1909 SortId = 10, 1910 Template = RenderProductListTopFacetsCustom() 1911 }; 1912 1913 1914 customBlocksPage.ReplaceBlock(facetsBlockCustom); 1915 } 1916 1917 1918 } 1919 @helper CustomRenderProductListMenu() 1920 { 1921 if (Pageview.Device.ToString() != "Mobile") 1922 { 1923 var navigationMarkup = RenderNavigation(new 1924 { 1925 id = "leftnav", 1926 cssclass = "dwnavigation", 1927 startLevel = 1, 1928 endlevel = 5, 1929 template = "LeftNavigation.xslt", 1930 mode = "ecom" 1931 }); 1932 1933 <h2 class="u-margin-bottom">@Translate("Product categories")</h2> 1934 1935 <div class="u-padding-bottom--lg"> 1936 @navigationMarkup 1937 </div> 1938 } 1939 } 1940 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 1941 @using Dynamicweb.Core 1942 @using System 1943 @using System.Web 1944 @using System.Collections.Generic 1945 @using Dynamicweb.Rapido.Blocks 1946 1947 1948 @helper CustomGridView() 1949 { 1950 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 1951 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 1952 bool showPrice = !Pageview.AreaSettings.GetItem("ProductList").GetBoolean("HidePrice"); 1953 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 1954 string columnsCount = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetList("Columns") != null ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetList("Columns").SelectedValue : "4"; 1955 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToCartButton"); 1956 bool showViewButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowViewButton"); 1957 bool showFavoriteButton = !Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HideFavoriteButton"); 1958 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToDownloadButton"); 1959 bool showStock = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowStockAndShipping"); 1960 bool showNumber = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowProductNumber"); 1961 bool showStaticVariants = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowStaticVariants"); 1962 string cartButtonText = Dynamicweb.Core.Converter.ToInt32(columnsCount) >= 4 && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" ? Translate("Add to cart") : ""; 1963 string viewMoreText = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("ViewMoreText")) ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("ViewMoreText") : "View"; 1964 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 1965 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 1966 bool isPricesWithVATEnabled = Dynamicweb.Core.Converter.ToBoolean(Pageview.Area.EcomPricesWithVat); 1967 string imageZoomOnHover = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HoverImageZoom") ? "image-hover--zoom" : ""; 1968 bool secondaryImage = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("HoverAlternatineImage") != null ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("HoverAlternatineImage") : false; 1969 string footerClasses = showStaticVariants ? "u-min-h120px" : ""; 1970 1971 string quantityErrorMsg = Translate("The minimum quantity should be") + " " + "[[minimumQuantity]]" + " " + Translate("and divisible by") + " " + "[[quantityStep]]"; 1972 1973 <script id="ProductGridItemContainer" type="text/x-template"> 1974 {{#.}} 1975 <div id="Product{{id}}" data-template="ProductGridItem" data-preloader="overlay" class="grid__col-lg-@columnsCount grid__col-md-@columnsCount grid__col-sm-@columnsCount grid__col-xs-6 product-list__grid-item @imageZoomOnHover dw-mod"> 1976 {{#Product}} 1977 {{>ProductGridItem}} 1978 {{/Product}} 1979 </div> 1980 {{/.}} 1981 </script> 1982 1983 <script id="ProductGridItem" type="text/x-template"> 1984 {{#.}} 1985 @if (useGoogleTagManager) 1986 { 1987 <text>{{{googleEnchantImpression 'Product catalogue' currency googleImpression}}}</text> 1988 } 1989 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 1990 <input type="hidden" name="ProductID{{id}}" value="{{productId}}" /> 1991 1992 <div class="grid__cell product-list__grid-item__image dw-mod {{noImage}}"> 1993 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{brand}} {{name}}" class="u-block u-position-relative image-hover__wrapper dw-mod"> 1994 <img class="grid__cell-img grid__cell-img--centered u-padding b-lazy" src="/Files/Images/placeholder.gif" 1995 data-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;FillCanvas=true&amp;DoNotUpscale=true&amp;image={{image}}" 1996 @if (secondaryImage) { <text> 1997 {{#if secondaryImage}} 1998 data-secondary-image-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;FillCanvas=true&amp;DoNotUpscale=true&amp;image={{secondaryImage}}" 1999 {{/if}} 2000 </text> } 2001 alt="{{brand}} {{name}}" /> 2002 {{#StickersContainers}} 2003 {{>StickersContainer}} 2004 {{/StickersContainers}} 2005 </a> 2006 @if (showFavoriteButton) 2007 { 2008 <div class="favorites favorites--for-grid-view u-pull--right {{hasVariants}} dw-mod" {{hasVariants}}> 2009 {{#Favorite}} 2010 {{>FavoriteTemplate}} 2011 {{/Favorite}} 2012 </div> 2013 } 2014 </div> 2015 2016 <div class="grid__cell product-list__grid-item__price-info {{shortGridInfo}} dw-mod"> 2017 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{brand}} {{name}}"> 2018 <h6 class="u-condensed-text product-title">{{brand}} {{name}}</h6> 2019 </a> 2020 @if (showNumber) 2021 { 2022 <div class="item-number dw-mod">{{number}}</div> 2023 } 2024 2025 @if (showPrice && !onlyPreview) 2026 { 2027 if (pointShopOnly) 2028 { 2029 <text> 2030 {{#if havePointPrice}} 2031 <div class="price price--product-list dw-mod">{{points}} @Translate("points")</div> 2032 {{else}} 2033 @Translate("Not available") 2034 {{/if}} 2035 </text> 2036 } 2037 else 2038 { 2039 <div class="price price--product-list dw-mod">{{priceWithoutVAT}}</div> 2040 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 2041 if (showVATPrice) 2042 { 2043 <div class="vat-price vat-price--product-list dw-mod"> 2044 @if (isPricesWithVATEnabled) 2045 { 2046 <span>(@Translate("excl. VAT")</span><span> {{priceWithoutVAT}})</span> 2047 } 2048 else 2049 { 2050 <span>(@Translate("incl. VAT")</span><span> {{priceWithVAT}})</span> 2051 } 2052 </div> 2053 } 2054 } 2055 } 2056 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 2057 <input type="hidden" value="{{variantid}}" name="VariantID{{id}}" id="Variant_{{id}}" /> 2058 </div> 2059 <div class="product-list__grid-item__footer @footerClasses dw-mod"> 2060 @if (!onlyPreview && showCartButton) 2061 { 2062 <div class="u-ta-center u-inline-block"> 2063 <div class="buttons-collection {{hideBuyOptions}}"> 2064 @if (pointShopOnly) 2065 { 2066 <button type="button" id="CartButton_{{id}}" class="btn btn--primary btn--condensed u-no-margin dw-mod js-cart-btn {{disabledBuyButton}} {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 2067 onclick="Cart.AddToCart(event, { 2068 id: {{productId}}', 2069 variantId: '{{variantid}}', 2070 unitId: '{{unitId}}', 2071 quantity: 1, 2072 buyForPoints: true, 2073 productInfo: {{productInfo}} 2074 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 2075 <i class="@cartIcon"></i><span class="u-hidden-xs u-hidden-xxs"> @Translate("Buy with points")</span> 2076 </button> 2077 } 2078 else 2079 { 2080 <button type="button" id="CartButton_{{id}}" class="js-cart-btn btn btn--primary btn--condensed u-no-margin u-pull--right dw-mod {{disabledBuyButton}}" name="submit" 2081 onclick="AedApi.addProductsToCart(event, { 2082 id: '{{productId}}', 2083 variantId: '{{variantid}}', 2084 unitId: '{{unitId}}', 2085 count: '{{id}}', 2086 quantity: document.getElementById('Quantity_{{id}}').value, 2087 productInfo: {{productInfo}}, 2088 errorMsg: '@quantityErrorMsg', 2089 quantityStep: '{{salesIncrement}}', 2090 minimumQuantity: '{{salesMinimumQuantity}}' 2091 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 2092 <i class="@cartIcon"></i><span class="u-hidden-xs u-hidden-xxs"> @cartButtonText</span> 2093 </button> 2094 <input type="number" class="u-w80px u-pull--right use-btn-primary-height" onchange="AedApi.handleQuantityChange('{{productId}}', '{{id}}');" id="Quantity_{{id}}" name="Quantity{{id}}" value="{{salesMinimumQuantity}}" min="{{salesMinimumQuantity}}" step="{{salesIncrement}}" /> 2095 } 2096 </div> 2097 </div> 2098 if (showViewButton) 2099 { 2100 <div class="u-ta-center {{hideViewMore}}"> 2101 <a href="{{link}}" id="CartButton_{{id}}" class="btn btn--secondary btn--full u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(viewMoreText)">@Translate(viewMoreText)</a> 2102 </div> 2103 } 2104 2105 } 2106 else if (showViewButton) 2107 { 2108 <div class="u-ta-center"> 2109 <a href="{{link}}" id="CartButton_{{id}}" class="btn btn--secondary btn--full u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(viewMoreText)">@Translate(viewMoreText)</a> 2110 </div> 2111 } 2112 <div class="quantity-error-msg" id="quantity-validation-box_{{productId}}"> 2113 2114 </div> 2115 @if (!onlyPreview && showStock) 2116 { 2117 <div class="u-margin-top"> 2118 <div><span class="stock-icon {{stockState}} u-no-margin dw-mod" title="{{stockText}}"></span> {{stockText}}</div> 2119 <div> 2120 {{#if deliveryText}} 2121 {{deliveryText}} 2122 {{/if}} 2123 </div> 2124 </div> 2125 } 2126 2127 @if (showStaticVariants) 2128 { 2129 <text> 2130 {{#Variants}} 2131 {{>StaticVariantsTemplate}} 2132 {{/Variants}} 2133 2134 {{#ifCond variantGroupsCount '>' 1}} 2135 <div class="static-variant"> 2136 @Translate("More options available") 2137 </div> 2138 {{/ifCond}} 2139 2140 {{#ifCond variantGroupsCount '==' 0}} 2141 <div class="static-variant"></div> 2142 {{/ifCond}} 2143 </text> 2144 } 2145 2146 @if (showAddToDownloadButton && Pageview.User != null) 2147 { 2148 <button type="button" class="btn btn--primary u-no-margin u-margin-top btn--condensed dw-mod js-add-to-downloads" title="@Translate("Add")" data-product-id="{{productId}}"> 2149 <i class="fas fa-plus js-button-icon"></i> 2150 <span class="js-button-text">@Translate("Add")</span> 2151 </button> 2152 } 2153 </div> 2154 {{/.}} 2155 </script> 2156 } 2157 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2158 @using Dynamicweb.Core 2159 @using System 2160 @using System.Web 2161 @using System.Collections.Generic 2162 @using Dynamicweb.Rapido.Blocks 2163 2164 @helper CustomListView() 2165 { 2166 string pageId = GetGlobalValue("Global:Page.ID"); 2167 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 2168 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 2169 bool showPrice = !Pageview.AreaSettings.GetItem("ProductList").GetBoolean("HidePrice"); 2170 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 2171 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("ShowAddToCartButton"); 2172 bool showViewButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("ShowViewButton"); 2173 bool showFavoriteButton = !Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("HideFavoriteButton"); 2174 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("ShowAddToDownloadButton"); 2175 bool showStock = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("ShowStockAndShipping"); 2176 bool showNumber = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("ShowProductNumber"); 2177 bool showVariantSelector = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetList("Variants").SelectedValue == "selector" ? true : false; 2178 bool showStaticVariants = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetList("Variants").SelectedValue == "static" ? true : false; 2179 string viewMoreText = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetString("ViewMoreText")) ? Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetString("ViewMoreText") : "View"; 2180 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 2181 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 2182 bool isPricesWithVATEnabled = Dynamicweb.Core.Converter.ToBoolean(Pageview.Area.EcomPricesWithVat); 2183 string imageZoomOnHover = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("HoverImageZoom") ? "image-hover--zoom" : ""; 2184 bool secondaryImage = Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetString("HoverAlternatineImage") != null ? Pageview.AreaSettings.GetItem("ProductList").GetItem("ListView").GetBoolean("HoverAlternatineImage") : false; 2185 2186 2187 string quantityMsgError = Translate("The minimum quantity should be") + " " + "[[minimumQuantity]]" + " " + Translate("and divisible by") + " " + "[[quantityStep]]"; 2188 2189 <script id="ProductItemContainer" type="text/x-template"> 2190 {{#.}} 2191 <div id="Product{{id}}" class="grid__col-12 js-product dw-mod" data-template="ProductItem" data-preloader="overlay"> 2192 {{#Product}} 2193 {{>ProductItem}} 2194 {{/Product}} 2195 </div> 2196 {{/.}} 2197 </script> 2198 2199 <script id="ProductItem" type="text/x-template"> 2200 {{#.}} 2201 @if (useGoogleTagManager) 2202 { 2203 <text>{{{googleEnchantImpression 'Product catalogue' currency googleImpression}}}</text> 2204 } 2205 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 2206 <input type="hidden" name="ProductID{{id}}" value="{{productId}}" /> 2207 <input type="hidden" value="{{variantid}}" name="VariantID{{id}}" id="Variant_{{id}}" /> 2208 2209 <div class="grid product-list__list-item dw-mod"> 2210 <div class="grid__col-md-4 {{noImage}} product-list__list-item__left u-no-padding u-color-light--bg dw-mod @imageZoomOnHover"> 2211 <div class="grid__cell"> 2212 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{brand}} {{name}}" class="u-position-relative u-block image-hover__wrapper dw-mod"> 2213 <img class="grid__cell-img grid__cell-img--centered b-lazy" src="/Files/Images/placeholder.gif" 2214 data-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;DoNotUpscale=true&amp;FillCanvas=true&amp;image={{image}}" 2215 @if (secondaryImage) { <text> 2216 {{#if secondaryImage}} 2217 data-secondary-image-src="/Admin/Public/GetImage.ashx?width=300&amp;height=300&amp;crop=5&amp;Compression=75&amp;FillCanvas=true&amp;DoNotUpscale=true&amp;image={{secondaryImage}}" 2218 {{/if}} 2219 </text> } 2220 alt="{{name}}" /> 2221 {{#StickersContainers}} 2222 {{>StickersContainer}} 2223 {{/StickersContainers}} 2224 </a> 2225 </div> 2226 </div> 2227 <div class="grid__col-md-auto product-list__list-item__right dw-mod"> 2228 <div> 2229 <div class="u-pull--left"> 2230 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{brand}} {{name}}"> 2231 <h2 class="u-no-margin">{{brand}} {{name}}</h2> 2232 </a> 2233 2234 @if (showNumber) 2235 { 2236 <div class="item-number dw-mod">{{number}}</div> 2237 } 2238 2239 @if (!onlyPreview && showStock) 2240 { 2241 <div> 2242 <span class="stock-icon {{stockState}} u-no-margin dw-mod" title="{{stockText}}"></span> 2243 <span class="u-margin-right--lg"> {{stockText}}</span> 2244 {{deliveryText}} 2245 </div> 2246 } 2247 2248 </div> 2249 2250 @if (showFavoriteButton) 2251 { 2252 <div class="favorites u-pull--right {{hasVariants}} dw-mod" {{hasVariants}}> 2253 {{#Favorite}} 2254 {{>FavoriteTemplate}} 2255 {{/Favorite}} 2256 </div> 2257 } 2258 </div> 2259 2260 <div class="grid__cell u-margin-top u-margin-bottom"> 2261 {{{description}}} 2262 </div> 2263 2264 @if (showCartButton && showVariantSelector) 2265 { 2266 <div data-template="VariantsTemplate" class="js-variants grid__cell" data-combinations="{{combinationsStringArray}}" data-variants="{{variantsStringArray}}" data-variant-selections="{{variantSelections}}" data-total-variant-groups="{{variantGroupsCount}}" data-selection-complete="UpdateData" data-page-id="@pageId" data-product-id="{{productId}}"> 2267 {{#Variants}} 2268 {{>VariantsTemplate}} 2269 {{/Variants}} 2270 </div> 2271 <small class="js-help-text help-text {{hideViewMore}} {{hideHelpText}}">@Translate("Please select variant!")</small> 2272 } 2273 2274 @if (showStaticVariants) 2275 { 2276 <text> 2277 {{#Variants}} 2278 {{>StaticVariantsTemplate}} 2279 {{/Variants}} 2280 {{#ifCond variantGroupsCount '>' 1}} 2281 <div class="static-variant"> 2282 @Translate("More options available") 2283 </div> 2284 {{/ifCond}} 2285 </text> 2286 } 2287 2288 @if (!onlyPreview) 2289 { 2290 <div class="grid__cell-footer"> 2291 <div class="grid__cell"> 2292 <div class="product-list__list-item__price-actions dw-mod"> 2293 @if (showPrice) 2294 { 2295 <div class="u-margin-bottom"> 2296 @if (pointShopOnly) 2297 { 2298 <text> 2299 {{#if havePointPrice}} 2300 <div class="price price--product-list dw-mod">{{points}} @Translate("points")</div> 2301 {{else}} 2302 @Translate("Not available") 2303 {{/if}} 2304 </text> 2305 } 2306 else 2307 { 2308 <div class="before-price {{onSale}} dw-mod">{{discount}}</div> 2309 <div class="price price--product-list dw-mod">{{priceWithoutVAT}}</div> 2310 if (showVATPrice) 2311 { 2312 <small class="vat-price vat-price--product-list dw-mod"> 2313 @if (isPricesWithVATEnabled) 2314 { 2315 @Translate("excl. VAT") <text>({{priceWithoutVAT}})</text> 2316 } 2317 else 2318 { 2319 @Translate("incl. VAT") <text>({{priceWithVAT}})</text> 2320 } 2321 </small> 2322 } 2323 } 2324 </div> 2325 } 2326 2327 @if (showCartButton) 2328 { 2329 string hasVariantsClass = ""; 2330 if (!showVariantSelector) 2331 { 2332 hasVariantsClass = "{{hasVariants}}"; 2333 } 2334 2335 if (pointShopOnly) 2336 { 2337 <text> 2338 {{#unless canBePurchasedWithPoints}} 2339 {{#if havePointPrice}} 2340 <small class="help-text u-no-margin u-margin-bottom">@Translate("Not enough points to buy this")</small> 2341 {{/if}} 2342 {{/unless}} 2343 </text> 2344 } 2345 <div class="buttons-collection buttons-collection--right @hasVariantsClass"> 2346 @if (pointShopOnly) 2347 { 2348 <button type="button" id="CartButton_{{id}}" class="btn btn--primary btn--condensed u-no-margin dw-mod u-pull--right js-cart-btn {{disabledBuyButton}} {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 2349 onclick="Cart.AddToCart(event, { 2350 id: '{{productId}}', 2351 variantId: '{{variantid}}', 2352 unitId: '{{unitId}}', 2353 quantity: 1, 2354 buyForPoints: true, 2355 productInfo: {{productInfo}} 2356 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 2357 <i class="@cartIcon"></i><span class="u-hidden-xs u-hidden-xxs"> @Translate("Buy with points")</span> 2358 </button> 2359 } 2360 else 2361 { 2362 <button type="button" id="CartButton_{{id}}" class="js-cart-btn btn btn--primary btn--condensed u-pull--right dw-mod {{disabledBuyButton}}" name="submit" 2363 onclick="AedApi.addProductsToCart(event, { 2364 id: '{{productId}}', 2365 variantId: '{{variantid}}', 2366 unitId: '{{unitId}}', 2367 count: '{{id}}', 2368 quantity: document.getElementById('Quantity_{{id}}').value, 2369 productInfo: {{productInfo}}, 2370 errorMsg: '@quantityMsgError', 2371 quantityStep: '{{salesIncrement}}', 2372 minimumQuantity: '{{salesMinimumQuantity}}' 2373 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 2374 <i class="@cartIcon"></i><span class="u-hidden-xs u-hidden-xxs"> @Translate("Add to cart")</span> 2375 </button> 2376 <input type="number" class="u-w80px u-margin-right u-pull--right use-btn-primary-height" onchange="AedApi.handleQuantityChange('{{productId}}', '{{id}}');" id="Quantity_{{id}}" name="Quantity{{id}}" value="{{salesMinimumQuantity}}" min="{{salesMinimumQuantity}}" step="{{salesIncrement}}"> 2377 } 2378 2379 <input type="checkbox" id="UnitOptions_{{id}}" class="dropdown-trigger" /> 2380 <div class="dropdown u-w150px u-w100px--xs use-btn-primary-height {{hasUnits}} dw-mod"> 2381 <label class="dropdown__header dropdown__btn dw-mod" for="UnitOptions_{{id}}">{{unitName}}</label> 2382 <div id="unitOptions" class="dropdown__content dw-mod"> 2383 {{#unitOptions}} 2384 {{>UnitOption}} 2385 {{/unitOptions}} 2386 </div> 2387 <label class="dropdown-trigger-off" for="UnitOptions_{{id}}"></label> 2388 </div> 2389 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 2390 <div class="grid__cell grid__cell--align-middle-left u-pull--left quantity-error-msg" id="quantity-validation-box_{{productId}}"></div> 2391 </div> 2392 } 2393 else if (showViewButton) 2394 { 2395 <div class="buttons-collection buttons-collection--right"> 2396 <a href="{{link}}" id="CartButton_{{id}}" title="@Translate(viewMoreText)" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" class="btn btn--secondary btn--full u-no-margin dw-mod"> 2397 @Translate(viewMoreText) 2398 </a> 2399 </div> 2400 } 2401 </div> 2402 </div> 2403 </div> 2404 } 2405 else 2406 { 2407 <button type="button" id="CartButton_{{id}}" class="u-hidden"></button> 2408 } 2409 2410 @if (showAddToDownloadButton && Pageview.User != null) 2411 { 2412 <div class="grid__cell-footer @((showCartButton || showViewButton) ? " u-margin-top" : "" )"> 2413 <div class="grid__cell"> 2414 <button type="button" class="btn btn--primary btn--condensed u-no-margin u-pull--right dw-mod js-add-to-downloads" title="@Translate(" Add")" data-product-id="{{productId}}"> 2415 <i class="fas fa-plus js-button-icon"></i> 2416 <span class="js-button-text">@Translate("Add")</span> 2417 </button> 2418 </div> 2419 </div> 2420 } 2421 </div> 2422 </div> 2423 {{/.}} 2424 </script> 2425 } 2426 2427 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2428 @using Dynamicweb.Core 2429 @using System 2430 @using System.Web 2431 @using System.Collections.Generic 2432 @using Dynamicweb.Rapido.Blocks 2433 2434 @helper CustomDetailsView() 2435 { 2436 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 2437 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 2438 bool showPrice = !Pageview.AreaSettings.GetItem("ProductList").GetBoolean("HidePrice"); 2439 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 2440 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowAddToCartButton"); 2441 bool showViewButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowViewButton"); 2442 bool showFavoriteButton = !Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("HideFavoriteButton"); 2443 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowAddToDownloadButton"); 2444 bool showStock = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowStockAndShipping"); 2445 bool showImage = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowImage"); 2446 bool showNumber = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowProductNumber"); 2447 bool showStaticVariants = Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetBoolean("ShowStaticVariants"); 2448 string viewMoreText = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetString("ViewMoreText")) ? Pageview.AreaSettings.GetItem("ProductList").GetItem("DetailsView").GetString("ViewMoreText") : "View"; 2449 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 2450 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 2451 bool isPricesWithVATEnabled = Dynamicweb.Core.Converter.ToBoolean(Pageview.Area.EcomPricesWithVat); 2452 2453 string quantityError = Translate("The minimum quantity should be") + " " + "[[minimumQuantity]]" + " " + Translate("and divisible by") + " " + "[[quantityStep]]"; 2454 <script id="ProductDetailsItemContainer" type="text/x-template"> 2455 {{#.}} 2456 <div id="Product{{id}}" data-template="ProductDetailsItem" data-preloader="overlay" class="grid__col-12 u-no-padding-y" style="z-index: {{zIndex}}"> 2457 {{#Product}} 2458 {{>ProductDetailsItem}} 2459 {{/Product}} 2460 </div> 2461 {{/.}} 2462 </script> 2463 2464 if (Pageview.Device.ToString() != "Mobile") 2465 { 2466 <script id="ProductDetailsItem" type="text/x-template"> 2467 {{#.}} 2468 @if (useGoogleTagManager) 2469 { 2470 <text>{{{googleEnchantImpression 'Product catalogue' currency googleImpression}}}</text> 2471 } 2472 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 2473 <input type="hidden" name="ProductID{{id}}" value="{{productId}}" /> 2474 <div class="product-list__details-item grid__col-12 dw-mod"> 2475 <div class="product-list__details-item__left grid__cell dw-mod"> 2476 @if (showImage) 2477 { 2478 <div class="lightbox u-hidden-xxs"> 2479 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{brand}} {{name}}"> 2480 <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="{{brand}} {{name}}" /> 2481 <div class="u-margin-right {{noImage}}"> 2482 <img class="b-lazy" src="/Files/Images/placeholder.gif" 2483 data-src="/Admin/Public/GetImage.ashx?width=75&amp;height=55&amp;crop=5&FillCanvas=true&amp;Compression=75&amp;image={{image}}" 2484 alt="{{brand}} {{name}}" /> 2485 </div> 2486 </a> 2487 </div> 2488 } 2489 <div class="u-margin-left u-margin-right"> 2490 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{brand}} {{name}}"> 2491 <h6 class="u-no-margin">{{brand}} {{name}}</h6> 2492 </a> 2493 <div class="item-number item-number--compressed dw-mod"> 2494 @if (showNumber) 2495 { 2496 <div class="item-number dw-mod">{{number}}</div> 2497 } 2498 2499 @if (!onlyPreview && showStock) 2500 { 2501 <span> 2502 <span class="stock-icon {{stockState}} u-no-margin dw-mod" title="{{stockText}}"></span> 2503 <span class="u-margin-right--lg"> {{stockText}}</span> 2504 {{deliveryText}} 2505 </span> 2506 } 2507 </div> 2508 @if (showStaticVariants) 2509 { 2510 <span> 2511 {{#Variants}} 2512 {{>StaticVariantsTemplate}} 2513 {{/Variants}} 2514 </span> 2515 <text> 2516 {{#ifCond variantGroupsCount '>' 1}} 2517 <div class="static-variant"> 2518 @Translate("More options available") 2519 </div> 2520 {{/ifCond}} 2521 </text> 2522 } 2523 <div class="grid__cell-footer stickers-container stickers-container--row u-margin-top dw-mod "> 2524 {{#StickersContainers}} 2525 {{#Stickers}} 2526 {{>MiniSticker}} 2527 {{/Stickers}} 2528 {{/StickersContainers}} 2529 </div> 2530 </div> 2531 </div> 2532 <div class="product-list__details-item__right grid--direction-column grid__cell dw-mod"> 2533 <div class="product-list__details-item__right grid__cell u-full-width"> 2534 @if (!onlyPreview && showCartButton) 2535 { 2536 <div class="u-margin-right"> 2537 <input type="checkbox" id="UnitOptions_{{id}}" class="dropdown-trigger" /> 2538 <div class="dropdown u-w120px use-btn-primary-height {{hasUnits}} dw-mod"> 2539 <label class="dropdown__header dropdown__btn dw-mod" for="UnitOptions_{{id}}">{{unitName}}</label> 2540 <div id="unitOptions" class="dropdown__content dw-mod"> 2541 {{#unitOptions}} 2542 {{>UnitOption}} 2543 {{/unitOptions}} 2544 </div> 2545 <label class="dropdown-trigger-off" for="UnitOptions_{{id}}"></label> 2546 </div> 2547 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 2548 <input type="hidden" value="{{variantid}}" name="VariantID{{id}}" id="Variant_{{id}}" /> 2549 </div> 2550 } 2551 2552 <div class="u-min-w140px product-list__details-item-price-block"> 2553 <div class="u-ta-right u-padding-right"> 2554 @if (pointShopOnly) 2555 { 2556 <text> 2557 {{#if havePointPrice}} 2558 <div class="price price--product-list price--micro dw-mod">{{points}} @Translate("points")</div> 2559 {{else}} 2560 @Translate("Not available") 2561 {{/if}} 2562 </text> 2563 } 2564 else 2565 { 2566 if (!onlyPreview) 2567 { 2568 <div class="before-price {{onSale}} before-price--micro dw-mod">{{discount}}</div> 2569 <div class="price price--product-list price--micro dw-mod">{{priceWithoutVAT}}</div> 2570 2571 } 2572 if (showVATPrice && !onlyPreview) 2573 { 2574 <small class="vat-price vat-price--micro dw-mod"> 2575 @if (isPricesWithVATEnabled) 2576 { 2577 @Translate("excl. VAT") <text>({{priceWithoutVAT}})</text> 2578 } 2579 else 2580 { 2581 @Translate("incl. VAT") <text>({{priceWithVAT}})</text> 2582 } 2583 2584 2585 </small> 2586 } 2587 } 2588 </div> 2589 </div> 2590 2591 @if (!onlyPreview && showCartButton) 2592 { 2593 if (!pointShopOnly) 2594 { 2595 <div class="{{hideBuyOptions}}"> 2596 <input type="number" class="u-w100px u-no-margin u-margin-right use-btn-primary-height" onchange="AedApi.handleQuantityChange('{{productId}}', '{{id}}');" id="Quantity_{{id}}" name="Quantity{{id}}" value="{{salesMinimumQuantity}}" min="{{salesMinimumQuantity}}" step="{{salesIncrement}}"> 2597 </div> 2598 } 2599 <div class="{{hideBuyOptions}}"> 2600 @if (pointShopOnly) 2601 { 2602 <button type="button" id="CartButton_{{id}}" class="btn btn--primary btn--condensed u-no-margin dw-mod js-cart-btn {{disabledBuyButton}} {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 2603 onclick="Cart.AddToCart(event, { 2604 id: '{{productId}}', 2605 variantId: '{{variantId}}', 2606 unitId: '{{UnitId}}', 2607 quantity: 1, 2608 buyForPoints: true, 2609 productInfo: {{productInfo}} 2610 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 2611 <i class="@cartIcon"></i><span> @Translate("Buy with points")</span> 2612 </button> 2613 } 2614 else 2615 { 2616 <button type="button" id="CartButton_{{id}}" class="js-cart-btn btn btn--primary btn--condensed u-pull--right u-no-margin dw-mod {{disabledBuyButton}}" name="submit" 2617 onclick="AedApi.addProductsToCart(event, { 2618 id: '{{productId}}', 2619 count: '{{id}}', 2620 variantId: '{{variantid}}', 2621 unitId: '{{unitId}}', 2622 quantity: document.getElementById('Quantity_{{id}}').value, 2623 productInfo: {{productInfo}}, 2624 errorMsg: '@quantityError', 2625 quantityStep: '{{salesIncrement}}', 2626 minimumQuantity: '{{salesMinimumQuantity}}' 2627 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 2628 <i class="@cartIcon"></i> 2629 </button> 2630 } 2631 2632 </div> 2633 if (showViewButton) 2634 { 2635 <text> 2636 {{#unless hideViewMore}} 2637 <div> 2638 <a href="{{link}}" class="btn btn--secondary u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(viewMoreText)">@Translate(viewMoreText)</a> 2639 </div> 2640 {{/unless}} 2641 </text> 2642 } 2643 } 2644 else if (showViewButton) 2645 { 2646 <div> 2647 <a href="{{link}}" class="btn btn--secondary u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(viewMoreText)">@Translate(viewMoreText)</a> 2648 </div> 2649 } 2650 @if (showFavoriteButton && Pageview.User != null) 2651 { 2652 <div class="favorites u-margin {{hasVariants}} dw-mod" {{hasVariants}}> 2653 {{#Favorite}} 2654 {{>FavoriteTemplate}} 2655 {{/Favorite}} 2656 </div> 2657 <div class="favorites favorites--lg u-hidden {{hasVariants}} dw-mod" {{hasVariants}}> 2658 {{#Favorite}} 2659 {{>FavoriteListItem}} 2660 {{/Favorite}} 2661 </div> 2662 } 2663 @if (showAddToDownloadButton && Pageview.User != null) 2664 { 2665 <button type="button" class="btn btn--primary u-no-margin btn--condensed u-margin-left u-margin-right dw-mod js-add-to-downloads" title="@Translate(" Add")" data-product-id="{{productId}}"> 2666 <i class="fas fa-plus js-button-icon"></i> 2667 </button> 2668 } 2669 </div> 2670 2671 <div class="grid__cell grid__cell--align-middle-left u-pull--left quantity-error-msg" id="quantity-validation-box_{{productId}}"></div> 2672 </div> 2673 </div> 2674 {{/.}} 2675 </script> 2676 } 2677 else 2678 { 2679 <script id="ProductDetailsItem" type="text/x-template"> 2680 {{#.}} 2681 @if (useGoogleTagManager) 2682 { 2683 <text>{{{googleEnchantImpression 'Product catalogue' currency googleImpression}}}</text> 2684 } 2685 <input type="hidden" name="ProductLoopCounter{{id}}" value="{{id}}" /> 2686 <input type="hidden" name="ProductID{{id}}" value="{{productId}}" /> 2687 <div class="grid__col-12 dw-mod"> 2688 <div class="grid__cell u-color-light--bg dw-mod"> 2689 <div class="u-margin"> 2690 <a href="{{link}}" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="{{name}}"> 2691 <h6 class="u-no-margin">{{name}}</h6> 2692 </a> 2693 <div class="item-number item-number--compressed dw-mod"> 2694 @if (showNumber) 2695 { 2696 <div class="item-number dw-mod">{{number}}</div> 2697 } 2698 2699 @if (!onlyPreview && showStock) 2700 { 2701 <span> 2702 <span class="stock-icon {{stockState}} u-no-margin dw-mod" title="{{stockText}}"></span> 2703 <span> {{stockText}}</span> 2704 {{deliveryText}} 2705 </span> 2706 } 2707 </div> 2708 @if (showStaticVariants) 2709 { 2710 <span> 2711 {{#Variants}} 2712 {{>StaticVariantsTemplate}} 2713 {{/Variants}} 2714 </span> 2715 <text> 2716 {{#ifCond variantGroupsCount '>' 1}} 2717 <div class="static-variant"> 2718 @Translate("More options available") 2719 </div> 2720 {{/ifCond}} 2721 </text> 2722 } 2723 <div class="grid__cell-footer stickers-container stickers-container--row u-margin-top dw-mod u-padding"> 2724 {{#StickersContainers}} 2725 {{#Stickers}} 2726 {{>MiniSticker}} 2727 {{/Stickers}} 2728 {{/StickersContainers}} 2729 </div> 2730 </div> 2731 @if (showPrice && !onlyPreview) 2732 { 2733 <div class="u-ta-right u-margin-bottom product-list__details-item-price-block dw-mod"> 2734 @if (pointShopOnly) 2735 { 2736 <text> 2737 {{#if havePointPrice}} 2738 <div class="price price--product-list price--micro dw-mod">{{points}} @Translate("points")</div> 2739 {{else}} 2740 @Translate("Not available") 2741 {{/if}} 2742 </text> 2743 } 2744 else 2745 { 2746 <div class="before-price {{onSale}} before-price--micro dw-mod">{{discount}}</div> 2747 <div class="price price--product-list price--micro dw-mod">{{price}}</div> 2748 } 2749 </div> 2750 } 2751 </div> 2752 <div class="grid__cell u-color-light--bg dw-mod"> 2753 <div class="collection u-pull--right u-no-margin u-margin dw-mod"> 2754 @if (!onlyPreview && showCartButton) 2755 { 2756 <div> 2757 <input type="checkbox" id="UnitOptions_{{id}}" class="dropdown-trigger" /> 2758 <div class="dropdown u-w120px use-btn-primary-height {{hasUnits}} dw-mod"> 2759 <label class="dropdown__header dropdown__btn dw-mod" for="UnitOptions_{{id}}">{{unitName}}</label> 2760 <div id="unitOptions" class="dropdown__content dw-mod"> 2761 {{#unitOptions}} 2762 {{>UnitOption}} 2763 {{/unitOptions}} 2764 </div> 2765 <label class="dropdown-trigger-off" for="UnitOptions_{{id}}"></label> 2766 </div> 2767 <input type="hidden" value="{{unitId}}" name="Unit{{id}}" id="Unit_{{id}}" /> 2768 <input type="hidden" value="{{variantid}}" name="VariantID{{id}}" id="Variant_{{id}}" /> 2769 </div> 2770 } 2771 2772 @if (!onlyPreview && showCartButton) 2773 { 2774 if (!pointShopOnly) 2775 { 2776 <div class="{{hideBuyOptions}}"> 2777 <input type="number" class="u-w50px u-no-margin use-btn-primary-height" id="Quantity_{{id}}" name="Quantity{{id}}" value="1" min="1"> 2778 </div> 2779 } 2780 <div class="{{hideBuyOptions}}"> 2781 @if (pointShopOnly) 2782 { 2783 <button type="button" id="CartButton_{{id}}" class="btn btn--primary btn--condensed u-no-margin dw-mod js-cart-btn {{disabledBuyButton}} {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 2784 onclick="Cart.AddToCart(event, { 2785 id: '{{productId}}', 2786 variantId: '{{variantId}}', 2787 unitId: '{{UnitId}}', 2788 quantity: 1, 2789 buyForPoints: true, 2790 productInfo: {{productInfo}} 2791 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 2792 <i class="@cartIcon"></i><span> @Translate("Buy with points")</span> 2793 </button> 2794 } 2795 else 2796 { 2797 <button type="button" id="CartButton_{{id}}" class="js-cart-btn btn btn--primary btn--condensed u-pull--right u-no-margin dw-mod {{disabledBuyButton}}" name="submit" 2798 onclick="Cart.AddToCart(event, { 2799 id: '{{productId}}', 2800 variantId: '{{variantid}}', 2801 unitId: '{{unitId}}', 2802 quantity: document.getElementById('Quantity_{{id}}').value, 2803 productInfo: {{productInfo}} 2804 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 2805 <i class="@cartIcon"></i> 2806 </button> 2807 } 2808 </div> 2809 if (showViewButton) 2810 { 2811 <text> 2812 {{#unless hideViewMore}} 2813 <div> 2814 <a href="{{link}}" class="btn btn--secondary u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(" View")">@Translate("View")</a> 2815 </div> 2816 {{/unless}} 2817 </text> 2818 } 2819 } 2820 else if (showViewButton) 2821 { 2822 <div> 2823 <a href="{{link}}" class="btn btn--secondary u-no-margin dw-mod" onclick="Scroll.SavePosition(event); {{googleImpressionClick}}" title="@Translate(" View")">@Translate("View")</a> 2824 </div> 2825 } 2826 @if (showFavoriteButton && Pageview.User != null) 2827 { 2828 <div class="favorites u-margin {{hasVariants}} dw-mod" {{hasVariants}}> 2829 {{#Favorite}} 2830 {{>FavoriteTemplate}} 2831 {{/Favorite}} 2832 </div> 2833 <div class="favorites favorites--lg u-hidden {{hasVariants}} dw-mod" {{hasVariants}}> 2834 {{#Favorite}} 2835 {{>FavoriteListItem}} 2836 {{/Favorite}} 2837 </div> 2838 } 2839 </div> 2840 </div> 2841 </div> 2842 {{/.}} 2843 </script> 2844 } 2845 } 2846 2847 @helper CustomRenderListActions() 2848 { 2849 @*This is part of a script template *@ 2850 2851 bool showSorting = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("EnableSorting"); 2852 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 2853 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 2854 bool isFavoriteList = !string.IsNullOrEmpty(listId); 2855 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 2856 2857 List<Block> subBlocks = this.productListActionsBlocksPage.GetBlockListById("Views").OrderBy(item => item.SortId).ToList(); 2858 var cartUrl = "/Default.aspx?ID=" + GetPageIdByNavigationTag("MiniCartFeed"); 2859 <div class="grid u-margin-bottom--lg"> 2860 @if (!isFavoriteList) 2861 { 2862 <div class="grid__col--bleed-y grid__col-md-auto u-no-padding-x"> 2863 <h2 class="u-ta-left"><i class="{{headerIcon}}"></i>{{header}}</h2> 2864 </div> 2865 } 2866 <div class="grid--align-end grid__col--bleed-y grid__col-md-auto u-no-padding-x grid--align-self-center"> 2867 <div class="collection u-no-margin"> 2868 @if (showSorting) 2869 { 2870 if (Pageview.Device.ToString() != "Mobile") 2871 { 2872 <h5 class="u-inline-block u-margin-right">@Translate("Sort by")</h5> 2873 } 2874 else 2875 { 2876 <h5 class="u-inline-block u-margin-right">@Translate("Sort")</h5> 2877 } 2878 <input type="checkbox" id="ProductSort" class="dropdown-trigger" /> 2879 <div class="dropdown u-w150px u-w120px--xs u-margin-right u-inline-block dw-mod"> 2880 <label class="dropdown__header dropdown__btn dropdown__btn--small dw-mod" for="ProductSort">{{selectedSort}}</label> 2881 <div class="dropdown__content dw-mod"> 2882 <div class="dropdown__item" onclick="HandlebarsBolt.UpdateQueryParameters('productList', { SortBy: '', SortOrder: '' }, true);">@Translate("Default")</div> 2883 <div class="dropdown__item" onclick="HandlebarsBolt.UpdateQueryParameters('productList', { SortBy: 'Created', SortOrder: 'DESC'}, true);">@Translate("Newest")</div> 2884 2885 </div> 2886 <label class="dropdown-trigger-off" for="ProductSort"></label> 2887 </div> 2888 } 2889 2890 @if (subBlocks.Count > 1) 2891 { 2892 foreach (Block item in subBlocks) 2893 { 2894 <input type="radio" class="tag-btn-trigger" id="ListViewBtn_@item.Id" name="ViewBtnGroup"> 2895 <label for="ListViewBtn_@item.Id" class="btn btn--tag u-no-margin" onclick="HandlebarsBolt.UpdateTemplate('ProductsContainer', '@item.Id')"><i class="fas fa-@item.Name"></i></label> 2896 } 2897 } 2898 2899 @if (isFavoriteList) 2900 { 2901 if (Pageview.Device.ToString() != "Mobile") 2902 { 2903 <button type="submit" id="add-multi" class="btn btn--primary btn--sm dw-mod u-no-margin" onclick="add(event, '@cartUrl');">@Translate("Buy all") <i class="@cartIcon"></i></button> 2904 } 2905 else 2906 { 2907 <button type="submit" class="btn btn--primary btn--full btn--sm u-margin-top dw-mod">@Translate("Buy all") <i class="@cartIcon"></i></button> 2908 } 2909 } 2910 </div> 2911 </div> 2912 </div> 2913 2914 } 2915 2916 <script src="~/Files/Templates/Designs/Rapido/js/jquery-3.4.1.min.js"></script> 2917 2918 <script> 2919 function add(event, cartUrl) { 2920 event.preventDefault(); 2921 var productsContainer = $("#ProductsContainer"); 2922 var overlayElement = $("<div>").addClass("preloader-overlay").attr("id", "overlay"); 2923 var overlayElementIcon = $("<div>").addClass("preloader-overlay__icon dw-mod").css("top", window.pageXOffset + "px"); 2924 $(overlayElement).append(overlayElementIcon); 2925 2926 if ($('#content')) { 2927 $(overlayElement).insertBefore($('#content')) 2928 } 2929 var productsDivs = $(productsContainer).children("div"); 2930 var products = {}; 2931 products["CartCmd"] = "addMulti"; 2932 for (var i = 0; i < productsDivs.length; i++) { 2933 var counter = i + 1; 2934 var currentProduct = $(productsDivs)[i]; 2935 var productId = $(currentProduct).find('input[type=hidden][name=ProductID' + (counter) + ']').val(); 2936 var productLoopCounter = $(currentProduct).find('input[type=hidden][name=ProductLoopCounter' + (counter) + ']').val(); 2937 var quantity = $(currentProduct).find('input[type=number][name=Quantity' + (counter) + ']').val(); 2938 var unit = $(currentProduct).find('input[type=hidden][name=Unit' + (counter) + ']').val(); 2939 products["ProductLoopCounter" + counter] = productLoopCounter; 2940 products["ProductID" + counter] = productId; 2941 products["VariantID" + counter] = ""; 2942 products["UnitID" + counter] = unit; 2943 products["Quantity" + counter] = quantity; 2944 2945 } 2946 2947 $.ajax({ 2948 type: "POST", 2949 url: cartUrl, 2950 data: products, 2951 async: true, 2952 success: function (data) { 2953 Cart.UpdateCart('miniCart', cartUrl, null, true); 2954 $(overlayElement).remove(); 2955 } 2956 }); 2957 } 2958 </script> 2959 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2960 @using Dynamicweb.Core 2961 @using System 2962 @using System.Web 2963 @using System.Collections.Generic 2964 @using Dynamicweb.Rapido.Blocks 2965 2966 @helper CustomRenderStickersTemplates() 2967 { 2968 <script id="StickersContainer" type="text/x-template"> 2969 <div class="stickers-container stickers-container--{{position}} dw-mod u-padding"> 2970 {{#Stickers}} 2971 {{>Sticker}} 2972 {{/Stickers}} 2973 </div> 2974 </script> 2975 2976 <script id="Sticker" type="text/x-template"> 2977 <div class="stickers-container__tag {{className}} dw-mod">{{text}}</div> 2978 </script> 2979 2980 <script id="MiniSticker" type="text/x-template"> 2981 <div class="stickers-container__tag stickers-container__tag--micro {{className}} dw-mod">{{text}}</div> 2982 </script> 2983 } 2984 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2985 @using Dynamicweb.Core 2986 @using System 2987 @using System.Web 2988 @using System.Collections.Generic 2989 @using Dynamicweb.Rapido.Blocks 2990 @helper RenderProductListTopFacetsCustom() 2991 { 2992 var expandedFacets = "js-remember-state"; 2993 var check = ""; 2994 if (Pageview.Device.ToString() == "Mobile") 2995 { 2996 expandedFacets = ""; 2997 check = "checked=\"true\""; 2998 } 2999 @*This is part of a script template *@ 3000 <input type="checkbox" id="CheckFacetGroups" class="@expandedFacets u-hidden" data-expand="CheckFacetGroups" @check /> 3001 <div class="grid grid--external-bleed-x dw-mod expandable--collapsed facets-container facets-container--top" data-trigger="CheckFacetGroups"> 3002 {{#FacetGroups}} 3003 <div class="grid__col-lg-3 grid__col-md-3 grid__col-sm-4 grid__col-xs-12"> 3004 <input type="checkbox" id="OptionsGroup_{{counter}}" class="dropdown-trigger" /> 3005 <div class="dropdown dw-mod js-filter"> 3006 <label class="dropdown__header dropdown__btn dw-mod" for="OptionsGroup_{{counter}}">{{name}}</label> 3007 <div class="dropdown__content dropdown__content--padding dw-mod"> 3008 <div class="u-margin-bottom {{showFilter}}"> 3009 <input type="text" class="u-full-width u-no-margin" onkeyup="Filter.FilterItems(event)" placeholder="@Translate("Search")" /> 3010 </div> 3011 {{#FacetOptions}} 3012 {{#ifCond template "===" "Checkboxes"}} 3013 {{>Checkboxes}} 3014 {{/ifCond}} 3015 {{#ifCond template "===" "Range"}} 3016 {{>Checkboxes}} 3017 {{/ifCond}} 3018 {{#ifCond template "===" "Weight"}} 3019 {{>Checkboxes}} 3020 {{/ifCond}} 3021 {{#ifCond template "===" "Tags"}} 3022 {{>Tags}} 3023 {{/ifCond}} 3024 {{#ifCond template "===" "Colors"}} 3025 {{>Colors}} 3026 {{/ifCond}} 3027 {{/FacetOptions}} 3028 </div> 3029 <label class="dropdown-trigger-off" for="OptionsGroup_{{counter}}"></label> 3030 </div> 3031 </div> 3032 {{/FacetGroups}} 3033 </div> 3034 <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod js-expand-hide facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Select filters")</label> 3035 <label for="CheckFacetGroups" class="btn btn--primary btn--full dw-mod expandable--collapsed facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Close filters")</label> 3036 }</text> 3037 } 3038 3039 @if (productListNavigation.BlocksList.Count < 1) { 3040 productListNavigation.Design.RenderType = RenderType.Hide; 3041 } 3042 3043 <form name="multiForm" id="multiForm" method="post"> 3044 <input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" /> 3045 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 3046 @RenderBlockList(productListPage.BlocksRoot.BlocksList) 3047 </form> 3048 3049 @helper RenderPageContainer() { 3050 List<Block> subBlocks = this.productListPage.GetBlockListById("PageContainer").OrderBy(item => item.SortId).ToList(); 3051 3052 string pageUrl = GetGlobalValue("Global:Pageview.Url.Raw"); 3053 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 3054 bool isFavoriteList = !string.IsNullOrEmpty(listId); 3055 string feedFullUrl = pageUrl + "&feed=true"; 3056 feedFullUrl += !isFavoriteList ? "&DoNotShowVariantsAsSingleProducts=True" : ""; 3057 string smallDeviceCss = Pageview.Device.ToString() == "Mobile" ? "" : "u-padding"; 3058 3059 <div class="grid grid--align-content-start @smallDeviceCss js-handlebars-root" id="productList" data-template="ProductContainer" data-pre-render-template="ProductPreRenderContainer" data-json-feed="@feedFullUrl" data-preloader="overlay"></div> 3060 3061 <script id="ProductContainer" type="text/x-template"> 3062 {{#each .}} 3063 @RenderBlockList(subBlocks) 3064 {{else}} 3065 <div class="grid__col-12"> 3066 <h2 class="u-ta-center">@Translate("Your search gave 0 results")</h2> 3067 </div> 3068 {{/each}} 3069 </script> 3070 } 3071 3072 @helper RenderProductList() { 3073 @*This is part of a script template *@ 3074 3075 List<Block> subBlocks = productListPage.GetBlockListById("ProductList").OrderBy(item => item.SortId).ToList(); 3076 3077 string pageId = GetGlobalValue("Global:Page.ID"); 3078 string pageUrl = GetGlobalValue("Global:Pageview.Url.Raw"); 3079 string listId = HttpContext.Current.Request.QueryString.Get("ListID"); 3080 bool isFavoriteList = !string.IsNullOrEmpty(listId); 3081 string feedFullUrl = pageUrl + "&feed=true"; 3082 feedFullUrl += !isFavoriteList ? "&DoNotShowVariantsAsSingleProducts=True" : ""; 3083 string smallDeviceCss = Pageview.Device.ToString() == "Mobile" ? "u-no-padding" : ""; 3084 3085 <div class="grid__col-lg-9 grid__col-sm-12 @smallDeviceCss"> 3086 @if (isFavoriteList) 3087 { 3088 string searchPlaceholder = Translate("Search favorite products", "Search favorite products"); 3089 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 3090 3091 <div class="grid__cell"> 3092 <div class="u-pull--left"> 3093 <h2 class="u-no-margin"><i class="{{headerIcon}}"></i>{{header}}</h2> 3094 </div> 3095 <div class="grid__col--bleed grid__col-6 u-pull--right"> 3096 <div class="u-margin-bottom"> 3097 <div class="typeahead u-color-inherit js-typeahead" data-page-size="10" id="FavoritesSearch" data-list-id="@listId" data-search-feed-id="@pageId&feed=true" data-result-page-id="@pageId"> 3098 <input type="text" class="typeahead-search-field u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 3099 <ul class="dropdown dropdown--absolute-position u-full-width js-handlebars-root js-typeahead-search-content u-min-w220px u-full-width dw-mod" id="FavoritesSearchContent" data-template="SearchProductsTemplate" data-json-feed="@feedFullUrl&ListID=@listId" data-init-onload="false" data-preloader="minimal"></ul> 3100 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="fas fa-search"></i></button> 3101 </div> 3102 </div> 3103 </div> 3104 </div> 3105 } 3106 3107 <div class="grid__cell"> 3108 @RenderBlockList(subBlocks) 3109 </div> 3110 </div> 3111 }