如何使用插件在多个小部件上显示产品

时间:2016-06-06 06:27:04

标签: nopcommerce

我已插入使用小部件显示产品。我想同时在多个小部件上显示产品。

e.g。我想同时在home_page_tophome_page_before_categorieshome_page_before_best_sellershome_page_before_newshome_page_before_poll展示产品。

我仍然使用单个小部件使用以下代码显示我的产品。

public IList<string> GetWidgetZones()
        {
return new List<string> { "home_page_top" };
}

 public void GetDisplayWidgetRoute(string widgetZone, out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            actionName = "list";
            controllerName = "product";
            routeValues = new RouteValueDictionary
            {
                {"Namespaces", "Nop.Plugin.product.product.Controllers"},
                {"area", null},
                {"widgetZone", widgetZone}
            };          
        }

1 个答案:

答案 0 :(得分:1)

试试这段代码:

public IList<string> GetWidgetZones()
{
     return new List<string> { "home_page_top", 
         "home_page_before_categories",
         "home_page_before_best_sellers", 
         "home_page_before_news", 
         "home_page_before_poll"
     };
}
相关问题