cancel
Showing results for 
Search instead for 
Did you mean: 

Magento2.4.2 error when create order pragmatically

Magento2.4.2 error when create order pragmatically

I followed this tutorial to create order https://webkul.com/blog/create-quote-and-order-programmatically-in-magento2/. This solution is working fine till Magento2.3.5. I'm facing following issue with Magento2.3.6 and 2.4 versions. 

I've tried

cache:flush

di:compile 

 

Type Error occurred when creating object: Magento\InventoryIndexer\Model\Queue\ReservationData, Argument 2 passed to Magento\InventoryIndexer\Model\Queue\ReservationData::__construct() 
must be of the type int, null given, called in /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121
1 REPLY 1

Re: Magento2.4.2 error when create order pragmatically

Try This:
rm -rf var/generation/*
bin/magento setup:di:compile
bin/magento cache:clean