2

I am facing very weird issue on my server while adding bundle product in the shopping cart.Whenever I am trying to add my bundle product, it gives me error like

Fatal error: Call to a member function getPosition() on a non-object in app/code/core/Mage/Bundle/Model/Product/Type.php on line 850.

While debugging in this file ,just find that first magento set it bundle product option and then find its position value .

magento set it option from this line

        $optionsCollection->appendSelections($selections, false, $_appendAllSelections);

from this method.

protected function _prepareProduct(Varien_Object $buyRequest, $product, $processMode)

But magento didn't set it option[Not sure why this occur] and try to get `Position .

Can any one help me to sort out this weired issue ?

Thanks

3 Answers 3

1

A few years late, but here is some info:

Have a look at this function:

Mage_Bundle_Model_Resource_Option_Collection::appendSelections

enter image description here

Notice the internal flag: $this->_selectionsAppended

If, this routine was called, at any point prior to your add to cart functionality, the line items will not get the product option appended to the product options, which then will result in the given error.

The noted routine is called from here:

Mage_Bundle_Model_Product_Type::_prepareProduct

and if that flag was set, no options tagged to object, error.

In the accepted answer the module that gt disabled is most likely making a call to this routine, causing the issue.

1
  • Thank you, was my problem !
    – Peekmo
    Commented May 17, 2019 at 12:53
0

It was my bad.

It create an issue due to 3rd party extension. After disabling the that extension its working fine.

1
  • I think I may be running into the same issue. Might you remember which extension you disabled? Commented Mar 12, 2017 at 15:43
0

Some time it happened for the wrong bundle_option selection id.so please check that array if you are adding bundle product using your own code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.