Override using plugin view engine doesn't work nop3.90

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 年 前
Hello,

I'm creating a plugin and I just want to override default view page: CategoryTemplate.ProductsInGridOrLines.cshtml

I've read many similar post and blogs and tried as following.


public PluginViewEngine()
{
    PartialViewLocationFormats =
        new[]
        {

            "~/Plugins/Nop.Plugins.MyPlugin.Test/Views/Catalog/{0}.cshtml"
        };

    ViewLocationFormats =
        new[]
        {

             "~/Plugins/Nop.Plugins.MyPlugin.Test/Views/Catalog/{0}.cshtml"
        };
}


And RegisterRoutes


public class RouteProvider : IRouteProvider
{
    public void RegisterRoutes(RouteCollection routes)
    {
        ViewEngines.Engines.Insert(0, new PluginViewEngine());
    }

    public int Priority
    {
        get
        {
            return 100;
        }
    }
}


Folder structure
-MyPlugin.Test
-Views
  -Catalog
   -CategoryTemplate.ProductsInGridOrLines.cshtml


But it's not working, what's wrong?
6 年 前
You don't have Nop.Plugins in your folder structure, it just named MyPlugin.Test.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.