Magento – Accessing a customer’s wishlist
$wishList = Mage::getSingleton('wishlist/wishlist')->loadByCustomer($customer); $wishListItemCollection = $wishList->getItemCollection(); if (count($wishListItemCollection)) { $arrProductIds = array(); foreach ($wishListItemCollection as $item) { /* @var $product Mage_Catalog_Model_Product */ $product = $item->getProduct(); $arrProductIds[] = $product->getId(); } }
The array variable $arrProductIds will now contain the list of all Product IDs that have been wishlisted by that specific Customer.