i have magento 2.3.4 and i'm installed Inventory and all commands working easy but with last command
php bin/magento setup:di:compile
i get this error
Class Magento\InventoryCatalog\Model\SourceItemsProcessor does not exist
any fix for this
Solved! Go to Solution.
this slove by me you will create file with name SourceItemsProcessor in path Magento\InventoryCatalog\Mode
and put this code
<?php
namespace Magento\InventoryCatalog\Model;
use Magento\InventoryApi\Api\Data\SourceItemInterface;
class SourceItemsProcessor
{
protected $sourceItemRepository;
public function __construct(
\Magento\InventoryApi\Api\SourceItemRepositoryInterface $sourceItemRepository
) {
$this->sourceItemRepository = $sourceItemRepository;
}
public function process(SourceItemInterface $sourceItem)
{
// Implement your source item processing logic here.
// You can access and modify the source item properties using $sourceItem.
// Example: Update the source item quantity.
$sourceItem->setQuantity(100);
// Save the updated source item.
$this->sourceItemRepository->save($sourceItem);
}
}
this slove by me you will create file with name SourceItemsProcessor in path Magento\InventoryCatalog\Mode
and put this code
<?php
namespace Magento\InventoryCatalog\Model;
use Magento\InventoryApi\Api\Data\SourceItemInterface;
class SourceItemsProcessor
{
protected $sourceItemRepository;
public function __construct(
\Magento\InventoryApi\Api\SourceItemRepositoryInterface $sourceItemRepository
) {
$this->sourceItemRepository = $sourceItemRepository;
}
public function process(SourceItemInterface $sourceItem)
{
// Implement your source item processing logic here.
// You can access and modify the source item properties using $sourceItem.
// Example: Update the source item quantity.
$sourceItem->setQuantity(100);
// Save the updated source item.
$this->sourceItemRepository->save($sourceItem);
}
}