Total Posts: 875
Kuala Lumpur, Malaysia
I have this:
$product->addAttributeUpdate('status', 2, 0);
and I can see that the Status is set to Disabled in the backend. However, the product is still listed with out of stock being displayed in the category page. And when I click on it, it returns a 404.
When I click Save in the backend, the product disappears in the category page, which is what I want. I couldn’t figure out why it’s listed in the category page when the status is set to disable programmatically. Anyone has any idea?
Mage::getModel('catalog/product_status')->updateProductStatus($product->getId(), $storeId, Mage_Catalog_Model_Product_Status::STATUS_DISABLED);