Mostview Product show on home page plugin route

182 views Asked by At

I've build plugin in nopCommerce for most view product show on home page, for that I make my Register Routes Method, that method call when site will run. But the problem is that method not call properly.

Here is my Route method:

public partial class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {

            routes.MapRoute("Plugin.MostViewCategoryProduct.MostViewProduct",
                 "Plugins/MostPopularProduct/MostViewProduct",
                 new { controller = "MostPopularProduct", action = "MostViewProduct" },
                 new[] { "Nop.Plugin.MostViewCategoryProduct.Controllers" }
            );
        }

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

Here is my Controller code:

public ActionResult MostViewProduct(int Id)
{        List<string>product_List=_mostviewproductservices.DisplayMostViewProduct();

     return View("~/Plugin/MostViewCategoryProduct/View/MostViewProduct.cshtml", product_List);

}
0

There are 0 answers