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

Error on adding product to cart
 
dinosaur
Jr. Member
 
Total Posts:  10
Joined:  2008-08-22
 

Hi, when i click the button add to cart in my store, it shows the following error, but the product is added to the cart anyway.

Error:

Recoverable Error: Argument 1 passed to Mage_Catalog_Helper_Image::init() must be an instance of Mage_Catalog_Model_Product, null given, called in /home/danielma/public_html/vanilla/app/design/frontend/default/telescope/template/checkout/cart.phtml on line 73 and defined in /home/danielma/public_html/vanilla/app/code/core/Mage/Catalog/Helper/Image.php on line 58
Trace:
#0 /home/danielma/public_html/vanilla/app/code/core/Mage/Catalog/Helper/Image.php(58): mageCoreErrorHandler(4096, ‘Argument 1 pass...’, ‘/home/danielma/...’, 58, Array)
#1 /home/danielma/public_html/vanilla/app/design/frontend/default/telescope/template/checkout/cart.phtml(73): Mage_Catalog_Helper_Image->init(NULL, ‘thumbnail’)
#2 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Template.php(138): include(’/home/danielma/...’)
#3 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Template.php(170): Mage_Core_Block_Template->fetchView(’frontend/defaul...’)
#4 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Template.php(187): Mage_Core_Block_Template->renderView()
#5 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Abstract.php(636): Mage_Core_Block_Template->_toHtml()
#6 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Text/List.php(37): Mage_Core_Block_Abstract->toHtml()
#7 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Abstract.php(636): Mage_Core_Block_Text_List->_toHtml()
#8 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Abstract.php(495): Mage_Core_Block_Abstract->toHtml()
#9 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Abstract.php(446): Mage_Core_Block_Abstract->_getChildHtml(’content’, true)
#10 /home/danielma/public_html/vanilla/app/design/frontend/default/telescope/template/page/1column.phtml(48): Mage_Core_Block_Abstract->getChildHtml(’content’)
#11 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Template.php(138): include(’/home/danielma/...’)
#12 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Template.php(170): Mage_Core_Block_Template->fetchView(’frontend/defaul...’)
#13 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Template.php(187): Mage_Core_Block_Template->renderView()
#14 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Block/Abstract.php(636): Mage_Core_Block_Template->_toHtml()
#15 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Model/Layout.php(509): Mage_Core_Block_Abstract->toHtml()
#16 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Controller/Varien/Action.php(320): Mage_Core_Model_Layout->getOutput()
#17 /home/danielma/public_html/vanilla/app/code/core/Mage/Checkout/controllers/CartController.php(122): Mage_Core_Controller_Varien_Action->renderLayout()
#18 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Controller/Varien/Action.php(343): Mage_Checkout_CartController->indexAction()
#19 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(144): Mage_Core_Controller_Varien_Action->dispatch(’index’)
#20 /home/danielma/public_html/vanilla/app/code/core/Mage/Core/Controller/Varien/Front.php(168): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 /home/danielma/public_html/vanilla/app/Mage.php(420): Mage_Core_Controller_Varien_Front->dispatch()
#22 /home/danielma/public_html/vanilla/index.php(46): Mage::run()
#23 {main}

 
Magento Community Magento Community
Magento Community
Magento Community
 
dinosaur
Jr. Member
 
Total Posts:  10
Joined:  2008-08-22
 

I’ve found that this happens, because when a product is added to the cart then the user is redirected to the my cart page. So the problem is the my cart page wich is not working.

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