Any way that when you mark the Category UnPublished that all the items in that Category are marked UnPublished? If not, can I add this as a suggestion? Pleeeeeease?
Quickest way would be to manage product, search for product within the category, select the items & export selected items to excel. In Excel sheet, find the column labeled "Publish", change top cell to False, drag False value to bottom of sheet, re-import sheet back into Nop.
Any way that when you mark the Category UnPublished that all the items in that Category are marked UnPublished? If not, can I add this as a suggestion? Pleeeeeease?
You could do something like:
var prevPublished = category.Published;
...
if (prevPublished != category.Published) { var products = _productService.SearchProducts(categoryIds: new List<int> {category.Id}, showHidden: true); foreach (var product in products) { product.Published = category.Published; _productService.UpdateProduct(product); } }
In the Edit method of the CategoryController (Nop.Admin). But pay attention that one product can be assigned to more than one category.