Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Tracing errors
 
matponta
Member
 
Total Posts:  39
Joined:  2008-05-20
Italy
 

Hello to everyone.

In creating a shipment module, I must have messed up something as now the module shows in the admin but when I try to add something to the cart I get a
Can not add item to shopping cart
error message.

Is there any way I can track the origin of the exception?

Thank you
Mattia

 
Magento Community Magento Community
Magento Community
Magento Community
 
impulsis
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2008-01-16
Lviv, Ukraine
 

At the app/code/core/Mage/Checkout/controllers/CartController.php around line 177 find the

catch (Exception $e{
            Mage
::getSingleton('checkout/session')->addException($e$this->__('Can not add item to shopping cart'));
            
$this->_goBack();
        
}
and change it to something like
catch (Exception $e{
            Mage
::getSingleton('checkout/session')->addException($e$e->getMessage());
            
$this->_goBack();
        
}

... Just don’t forget to change it back when finished debugging. smile

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top