Skip to content

Magento: Display selected product options in cart

hmmm… here we go

$itemsVisible = Mage::getSingleton(‘checkout/session’)->getQuote()->getAllVisibleItems();
foreach($itemsVisible as $item) {

$selected_options= $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());

print_r($selected_options);

}

//the result will be like this, haha:

/*

[0] => Array
(
[label] => Depth
[value] => 3/8"
[print_value] => 3/8"
[option_id] => 26
[option_type] => drop_down
[option_value] => 58
[custom_view] =>
)

[1] => Array
(
[label] => Accessories
[value] => Aluminium
[print_value] => Aluminium
[option_id] => 25
[option_type] => drop_down
[option_value] => 53
[custom_view] =>
)

*/

Share

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *