public function getWishlistProductId() //获得用户所有喜欢、收藏的产品 wishlist
{
$customer = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*');
$wishList = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer);
$wishListItemCollection = $wishList->getItemCollection();
if (count($wishListItemCollection)) {
$arrProductIds = array();
foreach ($wishListItemCollection as $item) {
$arrProductIds[] = $item->getProductId();
}
}
// Now here you can take that array and do what you want with it.
return $arrProductIds;
}