I know that manufacturer(s) can be removed, but what I would like to do is temporarily disable specific manufacturer(s) in my database so that the products associated with them are not visible in the front end.
How can this be achieved?
Put this script in your root directory and run it. Change the manufacturer name and Change the status when you want to revert them.
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
$_products = Mage::getResourceModel('catalog/product_collection');
$_products->addAttributeToFilter('manufacturer', array(
'in' => 'YOUR_MFG',
));
$storeid = 0; // your store id 0 is the default id
foreach($_products as $_product){
//change STATUS_DISABLED to STATUS_ENABLED to turn them back on
Mage::getModel('catalog/product_status')->updateProductStatus($_product->getId(), $storeid, Mage_Catalog_Model_Product_Status::STATUS_DISABLED);
}
I have two ways in mind:
You can write your own module, which filters the products by manufacturer, disables them and saves them again.
catalog_product_load_after
and catalog_product_load_before
catalog_product_load_after
observer you unset the ID if the manufacturer is the wrong onecatalog_product_collection_load_before
you add a filter for the manufacturer