- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023
11:11 AM
11-01-2023
11:11 AM
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.
Labels:
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023
11:44 AM
11-01-2023
11:44 AM
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); } }
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023
11:44 AM
11-01-2023
11:44 AM
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); } }