I am using NopCo开发者_运维技巧mmerce and i want to know how to show Featured Product home page???
Every product has ShowOnHomePage
property that is set from UI. All the products with this property set to true
will be shown on the home page.
However if you still want all the featured products from all the categories to show up on the home page irrespective of their ShowOnHomePage
property, then I'd recommend you to extend ProductService
class and to override GetAllProductsDisplayedOnHomePage
method which now (ver 1.9) extracts all the products with ShowOnHomePage
set to true
.
If you create your own ProductService
class, be sure to register it in UnityDependencyResolver
class. To keep the NopCommerce sources intact, I'd recommend to extend UnityDependencyResolver
class as well (i.e. to inherit a new class from it) and override ConfigureContainer
method (call the base method from the overriding one). If you define new dependency resolver class, be sure to configure it in web.config
.
精彩评论