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.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
using Grand.Web.Store.Extensions;
using Grand.Web.Common.Themes;
using Grand.Web.Common.View;
namespace Grand.Web.Admin.Infrastructure;
public class StoreAreaViewFactory : IAreaViewFactory
{
private readonly IThemeContext _themeContext;
public StoreAreaViewFactory(IThemeContextFactory themeContextFactory)
{
_themeContext = themeContextFactory.GetThemeContext(AreaName);
}
public string AreaName => Constants.AreaStore;
public IEnumerable<string> GetViewLocations(IEnumerable<string> viewLocations)
{
var themeName = _themeContext?.GetCurrentTheme();
var basicViewLocations = new[] {
$"/Areas/{AreaName}/Views/{{1}}/{{0}}.cshtml",
$"/Areas/{AreaName}/Views/Shared/{{0}}.cshtml"
};
if (string.IsNullOrWhiteSpace(themeName)) return basicViewLocations;
var themeViewLocations = new[] {
$"/Areas/{AreaName}/Themes/{themeName}/Views/{{1}}/{{0}}.cshtml",
$"/Areas/{AreaName}/Themes/{themeName}/Views/Shared/{{0}}.cshtml"
};
return themeViewLocations.Concat(basicViewLocations);
}
}