Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Change catalog settings from MaxBrandPageSize to MaxCatalogPageSize

support9d7982d5d58b
diff --git a/src/Core/Grand.Domain/Catalog/CatalogSettings.cs b/src/Core/Grand.Domain/Catalog/CatalogSettings.cs
index a19a844d4..a9e914dcc 100644
--- a/src/Core/Grand.Domain/Catalog/CatalogSettings.cs
+++ b/src/Core/Grand.Domain/Catalog/CatalogSettings.cs
@@ -411,9 +411,9 @@ namespace Grand.Domain.Catalog
public bool SortingByAvailability { get; set; }
/// <summary>
- /// Gets or sets the max value for page size to use for pagination on all brands page
+ /// Gets or sets the max value for page size to use for pagination on all brands/all collection/all vendors/ all categories page
/// </summary>
- public int MaxBrandPageSize { get; set; } = 10;
+ public int MaxCatalogPageSize { get; set; } = 10;
}
}
\ No newline at end of file
diff --git a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Partials/Catalog.TabGeneralSettings.cshtml b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Partials/Catalog.TabGeneralSettings.cshtml
index 5f1e78ca7..9741dc235 100644
--- a/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Partials/Catalog.TabGeneralSettings.cshtml
+++ b/src/Web/Grand.Web.Admin/Areas/Admin/Views/Setting/Partials/Catalog.TabGeneralSettings.cshtml
@@ -677,11 +677,11 @@
</div>
<div class="form-group">
<div class="col-6 col-md-6 col-sm-6">
- <admin-label asp-for="MaxBrandPageSize" class="control-label" />
+ <admin-label asp-for="MaxCatalogPageSize" class="control-label" />
</div>
<div class="col-6 col-md-6 col-sm-6">
- <admin-input asp-for="MaxBrandPageSize" />
- <span asp-validation-for="MaxBrandPageSize"></span>
+ <admin-input asp-for="MaxCatalogPageSize" />
+ <span asp-validation-for="MaxCatalogPageSize"></span>
</div>
</div>
<div class="form-group">
diff --git a/src/Web/Grand.Web.Admin/Models/Settings/CatalogSettingsModel.cs b/src/Web/Grand.Web.Admin/Models/Settings/CatalogSettingsModel.cs
index 18c24f952..61fe336f7 100644
--- a/src/Web/Grand.Web.Admin/Models/Settings/CatalogSettingsModel.cs
+++ b/src/Web/Grand.Web.Admin/Models/Settings/CatalogSettingsModel.cs
@@ -240,8 +240,8 @@ namespace Grand.Web.Admin.Models.Settings
[GrandResourceDisplayName("Admin.Settings.Catalog.DefaultCollectionPageSize")]
public int DefaultCollectionPageSize { get; set; }
- [GrandResourceDisplayName("Admin.Settings.Catalog.MaxBrandPageSize")]
- public int MaxBrandPageSize { get; set; }
+ [GrandResourceDisplayName("Admin.Settings.Catalog.MaxCatalogPageSize")]
+ public int MaxCatalogPageSize { get; set; }
[GrandResourceDisplayName("Admin.Settings.Catalog.ShowProductsFromSubcategoriesInSearchBox")]
public bool ShowProductsFromSubcategoriesInSearchBox { get; set; }
diff --git a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
index 7da873e33..43acc4ffc 100644
--- a/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
+++ b/src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
@@ -10038,8 +10038,8 @@
<Resource Name="Admin.Settings.Catalog.LimitOfFeaturedProducts" Area="Admin">
<Value>Limit Of Featured Products</Value>
</Resource>
- <Resource Name="Admin.Settings.Catalog.MaxBrandPageSize" Area="Admin">
- <Value>The max number of brands that can be displayed on the all brands page (page size)</Value>
+ <Resource Name="Admin.Settings.Catalog.MaxCatalogPageSize" Area="Admin">
+ <Value>Page size for the all page of brand/collection/vendor/category</Value>
</Resource>
<Resource Name="Admin.Settings.Catalog.NewProductsEnabled" Area="Admin">
<Value>'New products' page enabled</Value>
diff --git a/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_210.xml b/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_210.xml
index 748cb7a48..549cd28d7 100644
--- a/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_210.xml
+++ b/src/Web/Grand.Web/App_Data/Resources/Upgrade/en_210.xml
@@ -54,7 +54,7 @@
<Resource Name="Admin.Settings.Vendor.AllowToUploadFile" Area="Admin">
<Value>Allow vendor to upload picture file</Value>
</Resource>
- <Resource Name="Admin.Settings.Catalog.MaxBrandPageSize" Area="Admin">
- <Value>The max number of brands that can be displayed on the all brands page (page size)</Value>
+ <Resource Name="Admin.Settings.Catalog.MaxCatalogPageSize" Area="Admin">
+ <Value>Page size for the all page of brand/collection/vendor/category</Value>
</Resource>
</Language>
\ No newline at end of file
diff --git a/src/Web/Grand.Web/Features/Handlers/Catalog/GetBrandAllHandler.cs b/src/Web/Grand.Web/Features/Handlers/Catalog/GetBrandAllHandler.cs
index 48c13875c..79c018f60 100644
--- a/src/Web/Grand.Web/Features/Handlers/Catalog/GetBrandAllHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Catalog/GetBrandAllHandler.cs
@@ -43,9 +43,9 @@ namespace Grand.Web.Features.Handlers.Catalog
private async Task<List<BrandModel>> PrepareBrands(GetBrandAll request, BrandListModel brandListModel)
{
if (request.Command.PageNumber <= 0) request.Command.PageNumber = 1;
- if (request.Command.PageSize == 0 || request.Command.PageSize > _catalogSettings.MaxBrandPageSize)
+ if (request.Command.PageSize == 0 || request.Command.PageSize > _catalogSettings.MaxCatalogPageSize)
{
- request.Command.PageSize = _catalogSettings.MaxBrandPageSize;
+ request.Command.PageSize = _catalogSettings.MaxCatalogPageSize;
}
var model = new List<BrandModel>();
diff --git a/src/Web/Grand.Web/Features/Handlers/Catalog/GetCollectionAllHandler.cs b/src/Web/Grand.Web/Features/Handlers/Catalog/GetCollectionAllHandler.cs
index 9d8d34b4d..48ab534a9 100644
--- a/src/Web/Grand.Web/Features/Handlers/Catalog/GetCollectionAllHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Catalog/GetCollectionAllHandler.cs
@@ -51,9 +51,9 @@ namespace Grand.Web.Features.Handlers.Catalog
private async Task<List<CollectionModel>> PrepareCollectionAll(GetCollectionAll request, CollectionListModel collectionListModel)
{
if (request.Command.PageNumber <= 0) request.Command.PageNumber = 1;
- if (request.Command.PageSize == 0 || request.Command.PageSize > _catalogSettings.MaxBrandPageSize)
+ if (request.Command.PageSize == 0 || request.Command.PageSize > _catalogSettings.MaxCatalogPageSize)
{
- request.Command.PageSize = _catalogSettings.MaxBrandPageSize;
+ request.Command.PageSize = _catalogSettings.MaxCatalogPageSize;
}
var model = new List<CollectionModel>();