Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If MSI is disable : PHP Fatal error #10

Open
tales-desde-mileto opened this issue Dec 3, 2024 · 0 comments
Open

If MSI is disable : PHP Fatal error #10

tales-desde-mileto opened this issue Dec 3, 2024 · 0 comments

Comments

@tales-desde-mileto
Copy link

Hi:
If you have the MSI deactivated, and therefore, among other modules, you have deactivated:
'Magento_InventorySales' => 0,

Then we have this error, where the code is processing attribute: is_in_stock

PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\InventorySalesApi\Api\IsProductSalableInterface in /home/m2/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
Stack trace:
#0 /home/m2/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject()
#1 /home/m2/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#2 /home/m2/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#3 /home/m2/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#4 /home/m2/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#5 /home/m2/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create()
#6 /home/m2/public_html/app/code/RunAsRoot/GoogleShoppingFeed/Factory/AttributeHandlerFactory.php(33): Magento\Framework\ObjectManager\ObjectManager->create()
#7 /home/m2/public_html/app/code/RunAsRoot/GoogleShoppingFeed/DataProvider/AttributeHandlerProvider.php(39): RunAsRoot\GoogleShoppingFeed\Factory\AttributeHandlerFactory->create()
#8 /home/m2/public_html/app/code/RunAsRoot/GoogleShoppingFeed/Mapper/ProductToFeedAttributesRowMapper.php(31): RunAsRoot\GoogleShoppingFeed\DataProvider\AttributeHandlerProvider->get()
#9 /home/m2/public_html/app/code/RunAsRoot/GoogleShoppingFeed/Service/GenerateFeedForStore.php(139): RunAsRoot\GoogleShoppingFeed\Mapper\ProductToFeedAttributesRowMapper->map()

In RunAsRoot/GoogleShoppingFeed/DataProvider/AttributeHandlers/IsInStockProvider.php
We have:
use Magento\InventorySales\Model\AreProductsSalable;

But if you don't work with MSI this module is disable. The classic approach to this problem could be using StockRegistryInterface or something like this. Or change the preferences for

and rewrite an new Is ProductSalableResult

I don't know what the approach to this would be. Or if it is not directly proposed that the MSI is not active.

Thanks is advance

@tales-desde-mileto tales-desde-mileto changed the title If MSI is disable : If MSI is disable : PHP Fatal error Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant