Show only included products in magento my wishlist
1 answer
You will probably have to extend this class Mage_Wishlist_Model_Wishlist
and override the method getItemCollection
by adding a filter by status. Something like this (untested, just added the last method call):
$this->_itemCollection = Mage::getResourceModel('wishlist/item_collection')
->setStoreId($this->getStore()->getId())
->addWishlistFilter($this)
->addAttributeToFilter(
'status',
array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
);
Note that this would exclude disabled products every time you download a collection of wishlist items, not only from the wishlist page, but from potentially anywhere you display it, which I think is what you want.
+1
source to share