UNISEX GAME SHORTS 6.5 INCH
This item is from the Dunlop Clubwear collection and features the Flying D logo on the left leg. This collection contains modern teamwear designed for players of all levels. The clothing provides excellent ventilation and features high durability. The Club Line is easy to mix and match, thanks to its colour and design, and ensures that you can hit the courts in a sporty and comfortable tennis outfit.Dunlop has been one of the leading brands in the tennis world for over 130 years. Our clothing has been worn by clubs en spelers around the world for many years. The aim is to convey health and happiness. It doesn't matter where you play, how you play or how often you play. Through the quality of the fabrics used, Dunlop meets all the needs and wishes of its players.
Error executing template "Designs/Swift/Paragraph/Swift_ProductAddToCart_Custom.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_eaec0986dc6c4a0fa919e5386d5a3156.ExecuteAsync() at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Ecommerce.ProductCatalog 3 @using Dynamicweb.Core.Encoders 4 @using Dunlop.CustomCode 5 6 7 @{ 8 ProductViewModel product = null; 9 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 10 { 11 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 12 } 13 else if (Pageview.Page.Item["DummyProduct"] != null && Pageview.IsVisualEditorMode) 14 { 15 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 16 ProductListViewModel productList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 17 18 if (productList?.Products is object) 19 { 20 product = productList.Products[0]; 21 } 22 } 23 24 string anonymousUsersLimitations = Pageview.AreaSettings.GetRawValueString("AnonymousUsers", ""); 25 bool anonymousUser = Pageview.User == null; 26 bool isErpConnectionDown = !Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsWebServiceConnectionAvailable"]); 27 bool hideAddToCart = anonymousUsersLimitations.Contains("cart") && anonymousUser || Pageview.AreaSettings.GetBoolean("ErpDownHideAddToCart") && isErpConnectionDown; 28 hideAddToCart = Pageview.IsVisualEditorMode ? false : hideAddToCart; 29 if (!hideAddToCart && Pageview.IsB2cSite()) 30 { 31 bool showCartBtnAndPrice = Pageview.IsVisualEditorMode; 32 33 if (!showCartBtnAndPrice) 34 { 35 if (product != null && product.ProductFields.TryGetValue("ProductBuyableB2C", out FieldValueViewModel? productBuyableB2CField)) 36 { 37 showCartBtnAndPrice = (bool)(productBuyableB2CField?.Value ?? false); 38 } 39 } 40 hideAddToCart = !showCartBtnAndPrice; 41 } 42 43 var currentStockLocation = product.StockUnits.FirstOrDefault(o => o.StockLocationId.ToString() == Dynamicweb.Ecommerce.Common.Context.StockLocation.ID.ToString() && o.UnitName == product.DefaultUnitId); 44 var currentStockFromStockLocation = currentStockLocation.StockLevel; 45 46 } 47 48 @if (product is object && !hideAddToCart) 49 { 50 string horizontalAlign = Model.Item.GetRawValueString("HorizontalAlignment", ""); 51 horizontalAlign = horizontalAlign == "center" ? "justify-content-center" : horizontalAlign; 52 horizontalAlign = horizontalAlign == "end" ? "justify-content-end" : horizontalAlign; 53 horizontalAlign = horizontalAlign == "full" ? "" : horizontalAlign; 54 55 bool favoritesSelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowAddToFavorites")) ? Model.Item.GetBoolean("ShowAddToFavorites") : false; 56 bool quantitySelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowQuantitySelector")) ? Model.Item.GetBoolean("ShowQuantitySelector") : false; 57 bool unitsSelector = !string.IsNullOrEmpty(Model.Item.GetString("ShowUnitsSelector")) ? Model.Item.GetBoolean("ShowUnitsSelector") : false; 58 bool hideInventory = !string.IsNullOrEmpty(Model.Item.GetString("HideInventory")) ? Model.Item.GetBoolean("HideInventory") : false; 59 bool hideStockState = !string.IsNullOrEmpty(Model.Item.GetString("HideStockState")) ? Model.Item.GetBoolean("HideStockState") : false; 60 61 string buttonSize = Model.Item.GetRawValueString("ButtonSize", "regular"); 62 string inputSize = string.Empty; 63 64 switch (buttonSize) 65 { 66 case "small": 67 inputSize = " input-group-sm"; 68 buttonSize = " btn-sm"; 69 break; 70 case "regular": 71 buttonSize = string.Empty; 72 break; 73 case "large": 74 inputSize = " input-group-lg"; 75 buttonSize = " btn-lg"; 76 break; 77 } 78 79 string iconPath = "/Files/icons/"; 80 string url = "/Default.aspx?ID=" + (GetPageIdByNavigationTag("CartService")); 81 if (!url.Contains("LayoutTemplate")) 82 { 83 url += url.Contains("?") ? "&LayoutTemplate=Swift_MiniCart.cshtml" : "?LayoutTemplate=Swift_MiniCart.cshtml"; 84 } 85 86 string whenVariantsExist = Model.Item.GetRawValueString("WhenVariantsExist", "hide"); 87 string flexFill = Model.Item.GetRawValueString("HorizontalAlignment", "") == "full" ? "flex-fill" : ""; 88 string fullWidth = Model.Item.GetRawValueString("HorizontalAlignment", "") == "full" ? "w-100" : ""; 89 string addToCartIcon = Model.Item.GetRawValueString("Icon", iconPath + "shopping-cart.svg"); 90 string addToCartLabel = !addToCartIcon.Contains("_none") ? $"<span class=\"icon-2\">{ReadFile(addToCartIcon)}</span>" : ""; 91 addToCartLabel += !addToCartIcon.Contains("_none") && !Model.Item.GetBoolean("HideButtonText") ? " " : ""; 92 addToCartLabel += !Model.Item.GetBoolean("HideButtonText") ? $"<span class=\"d-none d-md-inline\">{Translate("Add to cart")}</span><span class=\"d-inline d-md-none\">{Translate("Add")}</span>" : ""; 93 bool isLazyLoadingForProductInfoEnabled = Dynamicweb.Core.Converter.ToBoolean(Dynamicweb.Context.Current.Items["IsLazyLoadingForProductInfoEnabled"]); 94 95 bool userHasPendingQuote = Dynamicweb.Ecommerce.Common.Context.Cart != null && Dynamicweb.Ecommerce.Common.Context.Cart.IsQuote; 96 97 if (product.VariantInfo.VariantInfo == null || whenVariantsExist == "disable") 98 { 99 string unitId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.Form.Get("UnitId")) ? Dynamicweb.Context.Current.Request.Form.Get("UnitId") : product.DefaultUnitId; 100 if (string.IsNullOrEmpty(unitId) && product?.UnitOptions != null) 101 { 102 if (product.UnitOptions.FirstOrDefault<UnitOptionViewModel>() != null) 103 { 104 unitId = product.UnitOptions.FirstOrDefault<UnitOptionViewModel>().Id; 105 } 106 } 107 108 double? stepQty = product.PurchaseQuantityStep > 0 ? product.PurchaseQuantityStep : 1; 109 double? minQty = product.PurchaseMinimumQuantity > 0 ? product.PurchaseMinimumQuantity : 1; 110 double? valueQty = minQty > stepQty ? minQty : stepQty; 111 string disableAddToCart = null; 112 double? maxQty = null; 113 114 if (product.ProductType == Dynamicweb.Ecommerce.Products.ProductType.Stock && !product.NeverOutOfstock && Pageview.IsB2cSite()) 115 { 116 disableAddToCart = (currentStockFromStockLocation <= 0) || (!product.NeverOutOfstock && isLazyLoadingForProductInfoEnabled) ? "disabled" : disableAddToCart; 117 maxQty = currentStockFromStockLocation; 118 } 119 else if (product.ProductType == Dynamicweb.Ecommerce.Products.ProductType.Stock && !product.NeverOutOfstock) 120 { 121 disableAddToCart = (product.StockLevel <= 0) || (!product.NeverOutOfstock && isLazyLoadingForProductInfoEnabled) ? "disabled" : disableAddToCart; 122 maxQty = product.StockLevel; 123 } 124 125 disableAddToCart = whenVariantsExist == "disable" && product.VariantInfo.VariantInfo != null && string.IsNullOrEmpty(product.VariantId) ? "disabled" : disableAddToCart; 126 127 if (unitsSelector && product.UnitOptions.Count > 0) 128 { 129 <form method="post" action="/Default.aspx?ID=@(Pageview.Page.ID)&ProductId=@product.Id" id="UnitSelectorForm_@(product.Id)_@(product.VariantId.Replace(".", "_"))_@Model.ID"> 130 <input type="hidden" name="redirect" value="false"> 131 <input type="hidden" name="VariantID" value="@product.VariantId"> 132 <input type="hidden" name="UnitID" class="js-unit-id" value="@unitId"> 133 </form> 134 } 135 136 <div class="d-flex @horizontalAlign @fullWidth js-input-group item_@Model.Item.SystemName.ToLower()"> 137 <form method="post" action="@url" class="@fullWidth" style="z-index: 1"> 138 <input type="hidden" name="redirect" value="false"> 139 <input type="hidden" name="ProductId" value="@product.Id"> 140 <input type="hidden" name="ProductName" value="@HtmlEncoder.HtmlEncode(product.Name)"> 141 <input type="hidden" name="ProductVariantName" value="@product.VariantName"> 142 <input type="hidden" name="ProductCurrency" value="@Dynamicweb.Ecommerce.Common.Context.Currency.Code"> 143 <input type="hidden" name="ProductPrice" value="@PriceViewModelExtensions.ToStringInvariant(product.Price)"> 144 <input type="hidden" name="ProductReferer" value="component_ProductAddToCart"> 145 <input type="hidden" name="cartcmd" value="add"> 146 <input type="submit" class="d-none" onclick="event.preventDefault(); swift.Cart.Update(event)"> @* Fix for enterKey should not redirect to minicart page *@ 147 148 @if (!string.IsNullOrEmpty(product.VariantId)) 149 { 150 <input type="hidden" name="VariantId" value="@product.VariantId"> 151 } 152 153 <template class="js-step-quantity-warning"> 154 <div class="modal-header"> 155 <h1 class="modal-title fs-5">@Translate("The quantity is not valid")</h1> 156 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 157 </div> 158 <div class="modal-body"> 159 @Translate("Please select a quantity that is dividable by") @stepQty 160 </div> 161 </template> 162 163 164 <template class="js-min-quantity-warning"> 165 <div class="modal-header"> 166 <h1 class="modal-title fs-5">@Translate("The product could not be added to the cart")</h1> 167 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 168 </div> 169 <div class="modal-body"> 170 @Translate("The quantity is not valid. You must buy at least") @product.PurchaseMinimumQuantity 171 </div> 172 </template> 173 174 175 @if (userHasPendingQuote) 176 { 177 <input type="hidden" name="PendingQuote" value="true"> 178 179 <template class="js-pending-quote-notice"> 180 <div class="modal-header"> 181 <h1 class="modal-title fs-5">@Translate("Pending Quote")</h1> 182 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="@Translate("Close")"></button> 183 </div> 184 <div class="modal-body"> 185 @Translate("You need to complete your current quote or empty the cart before adding this product to cart.") 186 </div> 187 </template> 188 } 189 190 @if (quantitySelector || (!anonymousUser && product.VariantInfo.VariantInfo != null) || (!anonymousUser && favoritesSelector)) 191 { 192 <input type="hidden" id="Unit_@(product.Id)_@product.VariantId.Replace(".", "_")" name="UnitID" value="@unitId" /> 193 } 194 195 <div class="d-flex flex-row w-100"> 196 @if (!quantitySelector) 197 { 198 <input id="Quantity_@(product.Id)_@product.VariantId.Replace(".", "_")" class="swift_quantity_field" name="Quantity" value="@valueQty" type="hidden" @disableAddToCart> 199 } 200 201 @if (unitsSelector && product.UnitOptions.Count > 0) 202 { 203 string selectedUnitName = !string.IsNullOrEmpty(unitId) && product?.UnitOptions != null ? unitId : product.UnitOptions.FirstOrDefault<UnitOptionViewModel>().Name; 204 205 foreach (var unitOption in product.UnitOptions) 206 { 207 if (unitOption.Id == unitId) 208 { 209 selectedUnitName = unitOption.Name; 210 } 211 } 212 213 <div class="d-flex flex-column gap-2 w-100"> 214 <div class="input-group input-primary-button-group flex-nowrap@(inputSize)"> 215 @if (!anonymousUser && favoritesSelector) 216 { 217 @RenderPartial("Components/ToggleFavorite.cshtml", product) 218 } 219 220 @if (quantitySelector) 221 { 222 <input id="Quantity_@(product.Id)_@product.VariantId.Replace(".", "_")" name="Quantity" value="@valueQty" step="@stepQty" min="@minQty" max="@maxQty" class="form-control swift_quantity-field" style="min-width: 80px; max-width: 100px; z-index: 1" type="number" @disableAddToCart> 223 } 224 225 <button class="btn btn-secondary @flexFill dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> 226 @selectedUnitName 227 </button> 228 229 <ul class="dropdown-menu swift_unit-field"> 230 @foreach (var unitOption in product.UnitOptions) 231 { 232 var selectedUnit = unitOption.Id == unitId ? "selected" : ""; 233 234 <li> 235 <button type="button" class="btn dropdown-item" data-value="@unitOption.Id" onclick="document.querySelector('#UnitSelectorForm_@(product.Id)_@(product.VariantId.Replace(".", "_"))_@Model.ID').querySelector('.js-unit-id').value = this.getAttribute('data-value'); 236 document.querySelector('#Unit_@(product.Id)_@product.VariantId.Replace(".", "_")').value = this.getAttribute('data-value'); 237 swift.PageUpdater.Update(document.querySelector('#UnitSelectorForm_@(product.Id)_@(product.VariantId.Replace(".", "_"))_@Model.ID'))"> 238 <span>@unitOption.Name</span> 239 <span> 240 @if (unitOption.StockLevel > 0 || unitOption.NeverOutOfStock) 241 { 242 if (!Model.Item.GetBoolean("HideInventory") && !unitOption.NeverOutOfStock) 243 { 244 <span class="small text-success">@unitOption.StockLevel @Translate("In stock")</span> 245 } 246 else 247 { 248 <span class="small text-success">@Translate("In stock")</span> 249 } 250 } 251 else 252 { 253 <span class="small text-danger">@Translate("Out of Stock")</span> 254 } 255 </span> 256 </button> 257 </li> 258 } 259 </ul> 260 </div> 261 <button type="button" onclick="swift.Cart.Update(event)" class="btn btn-primary @(buttonSize) js-add-to-cart-button" style="white-space: nowrap" @disableAddToCart title="@Translate("Add to cart")" id="AddToCartButton@(product.Id)_@Pageview.CurrentParagraph.ID"> 262 @if (!Model.Item.GetBoolean("HideButtonText")) 263 { 264 <span class="text-nowrap d-flex align-items-center justify-content-center gap-2"> 265 @addToCartLabel 266 </span> 267 } 268 else 269 { 270 @addToCartLabel 271 } 272 </button> 273 </div> 274 } 275 else 276 { 277 if (!anonymousUser && favoritesSelector) 278 { 279 @RenderPartial("Components/ToggleFavorite.cshtml", product) 280 } 281 282 <div class="input-group input-primary-button-group flex-nowrap@(inputSize)"> 283 @if (quantitySelector) 284 { 285 <input id="Quantity_@(product.Id)_@product.VariantId.Replace(".", "_")" name="Quantity" value="@valueQty" step="@stepQty" min="@minQty" max="@maxQty" class="form-control swift_quantity-field" style="min-width: 60px; max-width: 100px; z-index: 1" type="number" @disableAddToCart> 286 } 287 288 <button type="button" onclick="swift.Cart.Update(event)" class="btn btn-primary @(buttonSize) @flexFill js-add-to-cart-button" style="white-space: nowrap" @disableAddToCart title="@Translate("Add to cart")" id="AddToCartButton@(product.Id)_@Pageview.CurrentParagraph.ID"> 289 @if (!Model.Item.GetBoolean("HideButtonText")) 290 { 291 <span class="text-nowrap d-flex align-items-center justify-content-center gap-2"> 292 @addToCartLabel 293 </span> 294 } 295 else 296 { 297 @addToCartLabel 298 } 299 </button> 300 </div> 301 } 302 </div> 303 </form> 304 </div> 305 } 306 else if (whenVariantsExist == "modal") 307 { 308 string ButtonShape = Model.Item.GetRawValueString("VariantButtonShape", "square"); 309 string buttonAspectRatio = Model.Item.GetRawValueString("VariantImageAspectRatio", "56%"); 310 311 string buttonText = Translate("Select"); 312 string variantId = !string.IsNullOrWhiteSpace(product.VariantId) ? product.VariantId : product.DefaultVariantId; 313 314 string variantSelectorServicePageId = !string.IsNullOrEmpty(Model.Item.GetString("VariantSelectorServicePageId")) ? Model.Item.GetLink("VariantSelectorServicePageId").PageId.ToString() : ""; 315 variantSelectorServicePageId = variantSelectorServicePageId != "" ? variantSelectorServicePageId : GetPageIdByNavigationTag("VariantSelectorService").ToString(); 316 317 <div class="d-flex @horizontalAlign w-100 item_@Model.Item.SystemName.ToLower()"> 318 @if (!anonymousUser && favoritesSelector) 319 { 320 @RenderPartial("Components/ToggleFavorite.cshtml", product) 321 } 322 <form action="/Default.aspx?ID=@variantSelectorServicePageId" data-response-target-element="DynamicModalContent" data-preloader="inline" style="z-index: 1" class="@fullWidth"> 323 <input type="hidden" name="ProductID" value="@product.Id"> 324 <input type="hidden" name="VariantID" value="@variantId"> 325 <input type="hidden" name="QuantitySelector" value="@quantitySelector.ToString()"> 326 <input type="hidden" name="HideInventory" value="@hideInventory.ToString()"> 327 <input type="hidden" name="HideStockState" value="@hideStockState.ToString()"> 328 <input type="hidden" name="ButtonLayout" value="@ButtonShape"> 329 <input type="hidden" name="ButtonAspectRatio" value="@buttonAspectRatio"> 330 <input type="hidden" name="VariantSelectorServicePage" value="@variantSelectorServicePageId"> 331 <input type="hidden" name="ViewType" value="ModalContent"> 332 @if (isLazyLoadingForProductInfoEnabled) 333 { 334 @* If lazy loading is enabled, bypass it because we're loading a modal window, so render everything as if it was server-side *@ 335 <input type="hidden" name="getproductinfo" value="true"> 336 } 337 <button type="button" onclick="swift.PageUpdater.Update(event)" class="btn btn-primary@(buttonSize) @fullWidth" title="@Translate("Select")" data-bs-toggle="modal" data-bs-target="#DynamicModal" id="OpenVariantSelectorModal@(product.Id)_@Pageview.CurrentParagraph.ID">@buttonText</button> 338 </form> 339 </div> 340 } 341 } 342 else if (Pageview.IsVisualEditorMode) 343 { 344 <div class="alert alert-dark m-0">@Translate("No products available")</div> 345 } 346
Full specification
Care instructions | 0 |
Gender | Kids |
Brand | Dunlop |
Colour(s) | |
End user | Mens |
Number | 880321 |
Series | PERFORMANCE |
YOU MAY ALSO LIKE
Newsletter
JOIN OUR COMMUNITY
Be the first to hear about all the exclusive offers and latest news and events from Dunlop Sports.