Get cart visible products with custom options.
I have done with out custom options.
$cart = Mage::getModel('checkout/cart')->getQuote();
//$cart->getAllItems() //for all cart items
foreach ($cart->getAllVisibleItems() as $item) {
$productName = $item->getProduct()->getName();
$productPrice = $item->getProduct()->getPrice();
/*
//OR
echo 'ID: ' . $item->getProductId() . '<br />';
echo 'Name: ' . $item->getName() . '<br />';
echo 'Sku: ' . $item->getSku() . '<br />';
echo 'Quantity: ' . $item->getQty() . '<br />';
echo 'Price: ' . $item->getPrice() . '<br />';
*/
//get custom options
}
How can get custom options from this
$productOptions = $item->getProduct()
->getTypeInstance(true)
->getOrderOptions($item->getProduct());
Best Answer
Try this below code
OR