A Magento client of mine wanted to be able to change the calls to action on the cart and checkout pages based on the product configuration that the customers have selected for purchase. The following bit of code loops through the products in the Magento shopping basket and gets the chosen custom options and / or configuration.
// Load the session
$session = Mage::getSingleton(‘checkout/session’);
// Array to hold the final result
$finalResult = array();
// Loop through all items in the cart