I want to display a notification or message to the user; when he adds an item to the cart, which is limited to '1' item max. a message like : 'You can add 1 item maximum' . I did an observer to block the add but it shows me the error message in the log default magento. it's not pretty,I want to display it in the same page
My observer:
// Event: catalog_product_type_prepare_full_options
public function limit_(Varient_Event_Observer $observer) {
$quote = Mage::getSingleton('checkout/session')->getQuote();
if($quote->getItemsCount()>=1){
Mage::throwException('You can add 1 item maximum.');
}
}