How can I display all existing products in a catalog template?

7 months ago
3.90

I have created a catalog template: CategoryTemplate.ProductsInGridOrLines_allproducts.cshtml

How can I display all existing products in this category even if the product is unpublished?

Thanks in a advance.
7 months ago
Please check the "PrepareCategoryModel" method in the /Nop.Web/Factories/CatalogModelFactory.cs file.  It invokes the "productService.SearchProducts" method to load products.

Ensure that the "showHidden" parameter as passed with the "true" value