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

Page 3 of 3
Fatal Error ading productos to the cart
 
3rdRock
Member
 
Total Posts:  47
Joined:  2008-09-08
 

This seems to be tied to the shopping cart/coupon logic…

I attempted to use a try-catch statement in the file, but that didn’t work for some reason. I’m assuming because PHP is not recognizing it as OO code because it is not an object. So here is what I did instead:

Inside the Item.php, I added the following lines:

$mystoreid;

if (is_object($this->getQuote())) {
$mystoreid = $this->getQuote()->getStoreId();
} else {
$mystoreid = 0;
}

Then I changed the setStoreId line that was causing the error to the following:
$product = Mage::getModel(’catalog/product’)
->setStoreId($mystoreid)
->load($this->getProductId());

I don’t know if this will really working in the long run or if it might create greater problems later. I’ll have to test a few things out.

This has not resolved any of the issues I’m having with the shopping cart logic, but it has resolved the crashed cart issue on the main website.

wsj3 - 16 June 2009 03:51 PM

I’m having this problem too in 1.3.2.1. I have a configurable product which causes this fatal error when added to the cart.

Fatal error: Call to a member function getStoreId() on a non-object in /home/will/domains/growandmake.com/public_html/app/code/core/Mage/Sales/Model/Quote/Item.php on line 214

If anyone discovers a fix let us know.

FOLLOW-UP: After closing out my browser I went back and added the product to my cart again. This time it didn’t cause the error until I closed the browser and relaunched where the item was displayed in the cart on the left side of the page with the same error.

FURTHER FOLLOW-UP: I performed the hack described in this thread, which seems to be working. I really don’t want to leave this hack because I know at some point it will come back to create other problems. Varien please investigate and fix this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
fragilem17
Member
 
Total Posts:  56
Joined:  2009-02-15
 

Is this problem still in version 1.3.2.3 ?
Icant seem to find the code described above in my new store, so I guess the logic changed.
hopefully this is fixed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
fragilem17
Member
 
Total Posts:  56
Joined:  2009-02-15
 

issue: http://www.magentocommerce.com/bug-tracking/issue?issue=5942

seems to be fixed from version 1.3.2 onward according to magento..
user wsj3 however seems to still have it in 1.3.2.1 ?

I’ll update my store

 
Magento Community Magento Community
Magento Community
Magento Community
 
way2real
Jr. Member
 
Total Posts:  11
Joined:  2010-03-09
 

Magento 1.4.1.1 - Same thing happened to me, though I am not sure why.  From my store directory, I ended up running this shell command:  rm -rf var/cache/ var/session/ var/report/ media/tmp/ This cleans out some temporary files, cache, and sessions data.  It worked for me.  Hope it helps.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 3 of 3