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

getQuote->getStoreId() crashes when adding via querystring
 
mrspeaker
Member
 
Total Posts:  44
Joined:  2009-01-19
 

Hmm, when I try and add a bundled product via the querystring, like so:
http://localhost/magento/checkout/cart/add/product/237/?bundle_option[103][]=904

It crashes with the error:

Fatal errorCall to a member function getStoreId() on a non-object...
\app\code\core\Mage\Sales\Model\Quote\Item.php on line 210

Item.php has this call to get a product:

$product Mage::getModel('catalog/product')
        
// Daamn... this line crashes:
                
->setStoreId($this->getQuote()->getStoreId())
                ->
load($this->getProductId());

If I comment out the call to setStoreId, then it works correctly. I have multiple stores set up too.

Any ideas what could cause this error? Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrspeaker
Member
 
Total Posts:  44
Joined:  2009-01-19
 

Does anyone know why this error might occur? Can anyone else replicated it by going to /checkout/cart/add/product/237/?bundle_option[103][]=904
(where 237 is the product id, 103 is the option_id and 904 is the selection_id)

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