Magento – How to get the selected custom options of a item in wishlist

custom-optionsmagento-1.8wishlist

I need to retrieve the selected custom options of the item in the wishlist. I tried the following code.

$item = Mage::getModel('wishlist/item')->load($wishlist_item_id);

$options = $item->getProductOptions();

//$options = $item->getOptions();  
print_r( $options);die();

but it shows empty array. How to retrieve the selected options of the wishlist item?

Best Answer

Try this,

<?php
    $wishlist = Mage::getModel('wishlist/wishlist')->load($wishlist_id);
    $items = Mage::getResourceModel('wishlist/item_collection')->addWishlistFilter($wishlist);
    foreach ($items as $item){
        $options = $this->helper('catalog/product_configuration')->getOptions($item); 
        print_r($options);
    }
?>