cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.1 checkout error Uncaught Error: Call to undefined method Magento\Catalog\Model\Product\

SOLVED

Magento 2.3.1 checkout error Uncaught Error: Call to undefined method Magento\Catalog\Model\Product\

Magento 2.3.1 multistore.

After checkout 'place order' site goes loading. Then throws error:

Fatal error: Uncaught Error: Call to undefined method Magento\Catalog\Model\Product\Type\Simple::getConfigurableAttributeCollection() in /home/ortlieb/public_html/vendor/magento/module-configurable-product/Helper/Product/Options/Loader.php:52 Stack trace: #0 /home/ortlieb/public_html/vendor/magento/module-configurable-product/Model/Product/ReadHandler.php(48): Magento\ConfigurableProduct\Helper\Product\Options\Loader->load(Object(Magento\Catalog\Model\Product\Interceptor)) #1 /home/ortlieb/public_html/vendor/magento/framework/EntityManager/Operation/Read/ReadExtensions.php(48): Magento\ConfigurableProduct\Model\Product\ReadHandler->execute(Object(Magento\Catalog\Model\Product\Interceptor), Array) #2 /home/ortlieb/public_html/vendor/magento/framework/EntityManager/Operation/Read.php(112): Magento\Framework\EntityManager\Operation\Read\ReadExtensions->execute(Object(Magento\Catalog\Model\Product\Interceptor), Array) #3 /home/ortlieb/public_html/vendor/magento/framework/EntityManager/EntityManager.php(70): Magento\Framework\ in /home/ortlieb/public_html/vendor/magento/module-configurable-product/Helper/Product/Options/Loader.php on line 52

 

All help appreciated

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2.3.1 checkout error Uncaught Error: Call to undefined method Magento\Catalog\Model\Prod

Nope, Ultimo theme. Nothing special. Made a change here vendor/magento/module-configurable-product/Helper/Product/Options

 

In 'loader.php' did this:

starting at line 47 made this mod.

 

public function load(ProductInterface $product)
{
$options = [];
/** @var Configurable $typeInstance */
$typeInstance = $product->getTypeInstance();
if (get_class($typeInstance) == 'Magento\Catalog\Model\Product\Type\Simple' || get_class($typeInstance) == 'Magento\Bundle\Model\Product\Type')
{
return null;
}

 

 

So far so good. Not sure if real solution yet but did not yet see error again.

View solution in original post

2 REPLIES 2

Re: Magento 2.3.1 checkout error Uncaught Error: Call to undefined method Magento\Catalog\Model\Prod

Hello @emile_rdam 

 

Do you use any custom code to load product ?

 

If yes, then can u pls share the code here so we can debug easily.

 

If Found my answer useful Please give Kudos and Accept it as Solution.

Magento Developer
Ankita Biswas

Re: Magento 2.3.1 checkout error Uncaught Error: Call to undefined method Magento\Catalog\Model\Prod

Nope, Ultimo theme. Nothing special. Made a change here vendor/magento/module-configurable-product/Helper/Product/Options

 

In 'loader.php' did this:

starting at line 47 made this mod.

 

public function load(ProductInterface $product)
{
$options = [];
/** @var Configurable $typeInstance */
$typeInstance = $product->getTypeInstance();
if (get_class($typeInstance) == 'Magento\Catalog\Model\Product\Type\Simple' || get_class($typeInstance) == 'Magento\Bundle\Model\Product\Type')
{
return null;
}

 

 

So far so good. Not sure if real solution yet but did not yet see error again.