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.

Added Published check while getting the menu (#416)

SUNIL PARISI94813162f52b
diff --git a/src/Web/Grand.Web/Features/Handlers/Catalog/GetMenuHandler.cs b/src/Web/Grand.Web/Features/Handlers/Catalog/GetMenuHandler.cs
index 20b60db78..2c0eda1ab 100644
--- a/src/Web/Grand.Web/Features/Handlers/Catalog/GetMenuHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Catalog/GetMenuHandler.cs
@@ -67,7 +67,7 @@ namespace Grand.Web.Features.Handlers.Catalog
//top menu pages
var now = DateTime.UtcNow;
var pageModel = (await _pageService.GetAllPages(request.Store.Id))
- .Where(t => t.IncludeInMenu && (!t.StartDateUtc.HasValue || t.StartDateUtc < now) && (!t.EndDateUtc.HasValue || t.EndDateUtc > now))
+ .Where(t => t.Published && t.IncludeInMenu && (!t.StartDateUtc.HasValue || t.StartDateUtc < now) && (!t.EndDateUtc.HasValue || t.EndDateUtc > now))
.Select(t => new MenuModel.MenuPageModel
{
Id = t.Id,