You get the quote by:

    $quote = Mage::getSingleton('checkout/cart')->getQuote();

then you have access to all items:

    $quote->getAllItems()

And follow the instructions of the [original answer](http://magento.stackexchange.com/a/10670/243)