diff --git a/Directory.Build.props b/Directory.Build.props index bf446d11..b1d8df36 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,7 +7,7 @@ VirtoCommerce - 6.13.0 + 6.14.0 $(VersionSuffix)-$(BuildNumber) diff --git a/VirtoCommerce.Storefront/Controllers/Api/ApiCommonController.cs b/VirtoCommerce.Storefront/Controllers/Api/ApiCommonController.cs index 88271b75..56926462 100644 --- a/VirtoCommerce.Storefront/Controllers/Api/ApiCommonController.cs +++ b/VirtoCommerce.Storefront/Controllers/Api/ApiCommonController.cs @@ -67,16 +67,20 @@ public async Task GetInfoBySlugAsync(string slug, [FromQuery] st { var result = new SlugInfoResult(); - var seoInfos = await _seoInfoService.GetBestMatchingSeoInfos(slug, WorkContext.CurrentStore, culture); + if (string.IsNullOrEmpty(slug)) + { + return result; + } + var segments = slug.Split("/", StringSplitOptions.RemoveEmptyEntries); + var lastSegment = segments.Last(); + var seoInfos = await _seoInfoService.GetBestMatchingSeoInfos(lastSegment, WorkContext.CurrentStore, culture); var bestSeoInfo = seoInfos.FirstOrDefault(); - result.EntityInfo = bestSeoInfo; - if (result.EntityInfo == null) { - var pageUrl = slug == "home" ? "/" : $"/{slug}"; + var pageUrl = slug == "__index__home__page__" ? "/" : $"/{slug}"; try { var pages = WorkContext.Pages.Where(p =>