Hello All,
I am writing an REST API in magento to retrieve the wishlist data. I have written the below code, I got an "Invalid auth/bad request (got a 500, expected HTTP/1.1 20X or a redirect)" error message. Please suggest what is the issue.
PHP Code:
$customer = Mage::getSingleton('customer/session')->getCustomer();
$wishList = Mage::getSingleton(‘wishlist/wishlist’)->loadByCustomer($customer);
$wishListItemCollection = $wishList->getItemCollection();
if (count($wishListItemCollection)) {
$productId = array();
foreach ($wishListItemCollection as $item) {
$product = $item->getProduct();
$productId[] = $product->getId();
}
}
return $wishListItemCollection;
Thanks
View more threads in the same category:
Bookmarks