File tree Expand file tree Collapse file tree
Libraries/SmartStore.Core/Domain/Catalog
Presentation/SmartStore.Web Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -307,6 +307,8 @@ public CatalogSettings()
307307
308308 public bool ShowColorSquaresInLists { get ; set ; }
309309
310+ public bool HideBuyButtonInLists { get ; set ; }
311+
310312 public int ? LabelAsNewForMaxDays { get ; set ; }
311313
312314 public bool ShowDiscountSign { get ; set ; }
Original file line number Diff line number Diff line change @@ -164,6 +164,9 @@ public CatalogSettingsModel()
164164 [ SmartResourceDisplayName ( "Admin.Configuration.Settings.Catalog.ShowColorSquaresInLists" ) ]
165165 public bool ShowColorSquaresInLists { get ; set ; }
166166
167+ [ SmartResourceDisplayName ( "Admin.Configuration.Settings.Catalog.HideBuyButtonInLists" ) ]
168+ public bool HideBuyButtonInLists { get ; set ; }
169+
167170 [ SmartResourceDisplayName ( "Admin.Configuration.Settings.Catalog.IncludeShortDescriptionInCompareProducts" ) ]
168171 public bool IncludeShortDescriptionInCompareProducts { get ; set ; }
169172
Original file line number Diff line number Diff line change 387387 @Html.ValidationMessageFor(model => model .ShowColorSquaresInLists )
388388 </td >
389389 </tr >
390-
390+ <tr >
391+ <td class =" adminTitle" >
392+ @Html.SmartLabelFor(model => model .HideBuyButtonInLists )
393+ </td >
394+ <td class =" adminData" >
395+ @Html.SettingEditorFor(model => model .HideBuyButtonInLists )
396+ @Html.ValidationMessageFor(model => model .HideBuyButtonInLists )
397+ </td >
398+ </tr >
391399 <tr >
392400 <td class =" adminTitle" >
393401 @Html.SmartLabelFor(model => model .LabelAsNewForMaxDays )
Original file line number Diff line number Diff line change @@ -633,6 +633,7 @@ from a in colorAttr.ProductVariantAttributeValues.Take(50)
633633 model . DisplayBasePrice = _catalogSettings . ShowBasePriceInProductLists ;
634634 model . BasePriceInfo = minPriceProduct . GetBasePriceInfo ( _localizationService , _priceFormatter ) ;
635635 model . CompareEnabled = _catalogSettings . CompareProductsEnabled ;
636+ model . HideBuyButtonInLists = _catalogSettings . HideBuyButtonInLists ;
636637
637638 var addShippingPrice = _currencyService . ConvertCurrency ( minPriceProduct . AdditionalShippingCharge ,
638639 _currencyService . GetCurrencyById ( _currencySettings . PrimaryStoreCurrencyId ) , _workContext . WorkingCurrency ) ;
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ public ProductOverviewModel()
5454 public int ProductMinPriceId { get ; set ; }
5555 public bool CompareEnabled { get ; set ; }
5656 public bool IsNew { get ; set ; }
57+ public bool HideBuyButtonInLists { get ; set ; }
5758 //codehint: sm-add end
5859
5960 //price
Original file line number Diff line number Diff line change 160160
161161 <div class =" buttons" >
162162
163- @if (! Model .ProductPrice .DisableBuyButton )
163+ @if (! Model .ProductPrice .DisableBuyButton && ! Model . HideBuyButtonInLists )
164164 {
165165 var title = (Model .ProductPrice .AvailableForPreOrder ? T (" ShoppingCart.PreOrder" ) : T (" ShoppingCart.AddToCart" ));
166166 <a data-href =' @addtocartlink'
Original file line number Diff line number Diff line change 241241 <i class =" icon-info-sign" ></i >
242242 </a >
243243
244- @if (! Model .ProductPrice .DisableBuyButton )
244+ @if (! Model .ProductPrice .DisableBuyButton && ! Model . HideBuyButtonInLists )
245245 {
246246 <a data-href =' @addtocartlink'
247247 href =" #"
You can’t perform that action at this time.
0 commit comments