diff --git a/vendor/magento/module-inventory-catalog/Plugin/Catalog/Model/ResourceModel/Product/DeleteSourceItemsPlugin.php b/vendor/magento/module-inventory-catalog/Plugin/Catalog/Model/ResourceModel/Product/DeleteSourceItemsPlugin.php index 5e1130987a9a..49b111d66425 100644 --- a/vendor/magento/module-inventory-catalog/Plugin/Catalog/Model/ResourceModel/Product/DeleteSourceItemsPlugin.php +++ b/vendor/magento/module-inventory-catalog/Plugin/Catalog/Model/ResourceModel/Product/DeleteSourceItemsPlugin.php @@ -22,19 +22,12 @@ class DeleteSourceItemsPlugin */ private $publisher; - /** - * @var ScopeConfigInterface - */ - private $config; - /** * @param PublisherInterface $publisher - * @param ScopeConfigInterface $config */ - public function __construct(PublisherInterface $publisher, ScopeConfigInterface $config) + public function __construct(PublisherInterface $publisher) { $this->publisher = $publisher; - $this->config = $config; } /** @@ -48,14 +41,12 @@ public function __construct(PublisherInterface $publisher, ScopeConfigInterface */ public function afterDelete(Product $subject, $result, $product): Product { - if ($this->config->getValue('cataloginventory/options/synchronize_with_catalog')) { - $this->publisher->publish( - 'inventory.source.items.cleanup', - [ - (string)$product->getSku(), - ] - ); - } + $this->publisher->publish( + 'inventory.source.items.cleanup', + [ + (string)$product->getSku(), + ] + ); return $result; }