When I run Magento I get

PHP Fatal error: Call to undefined method Magento\Catalog\Api\Data\ProductExtension::setStockItem() in /var/www/magento/vendor/magento/module-catalog-inventory/Model/Plugin/AfterProductLoad.php on line 47

Please help


The problem seems to be that ProductExtension is not generated (this is auto-generated class).

If running Magento in production or default mode, code generation on-fly is disabled and you need to run compiler after installation, execute <project_root>/bin/magento setup:di:compile as described in Magento dev docs.

If running Magento in developer mode, make sure var/generation directory is writable.


try install

apt-get install php7.2-bcmath

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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