How to show the new products in Home page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
mhsjaber wrote:
It's not directory, but a C# file. It's in Nop.Web > Components directory.


I found the problem. Thank you so much.

I didn't change class. :)
3 years ago
mhsjaber wrote:
1. Copy HomepageProductsViewComponent.cs file and paste it in same directory.
2. Rename the file and its class name as NewProductsViewComponent.
3. Modify line no. 31 as below.
var products = _productService.SearchProducts(markedAsNewOnly: true).ToList();

4. Copy /Views/Shared/Components/HomepageProducts folder and paste it in same directory.
5. Rename the folder as NewProducts.


Got this error on homepage : System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Html.IHtmlContent]
after i debug the code, it seems NewProuductViewComponent class constructor is not executed, i think i miss some steps, any idea?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.