I am trying to get the wish list products in Magento 1.9, I am facing some problem. Based on customer id am fetching customer details, Unable to fetch the wishlist product collections.
$customer_id= 4;
$customer = Mage::getSingleton('customer/customer')->load($customer_id);
if($customer){
$wishList = Mage::getSingleton('wishlist/wishlist')->loadByCustomer($customer);
print_r($wishList);
$wishListItemCollection = $wishList->getItemCollection();
if (count($wishListItemCollection)) {
$arrProductIds = array();
foreach ($wishListItemCollection as $item) {
$product = $item->getProduct();
$arrProductIds[] = $product->getId();
}
}
}
Best Answer
I assume that the customer ID is 1 and you want tot get the wishlsit items of the customer having the customer ID 1.
Please use the code like below: