6 declare(strict_types=1);
32 private $isSourceItemManagementAllowedForProductType;
37 private $sourceItemsConfigurationProcessor;
42 private $isSingleSourceMode;
47 private $defaultSourceProvider;
59 $this->isSourceItemManagementAllowedForProductType = $isSourceItemManagementAllowedForProductType;
60 $this->sourceItemsConfigurationProcessor = $sourceItemsConfigurationProcessor;
61 $this->isSingleSourceMode = $isSingleSourceMode;
73 if ($this->isSourceItemManagementAllowedForProductType->execute(
$product->getTypeId()) ===
false) {
80 $assignedSources = [];
81 if ($this->isSingleSourceMode->execute()) {
83 $assignedSources[] = [
87 'notify_stock_qty_use_default' =>
91 $sources =
$controller->getRequest()->getParam(
'sources', []);
92 if (isset($sources[
'assigned_sources']) && is_array($sources[
'assigned_sources'])) {
93 $assignedSources = $sources[
'assigned_sources'];
97 $this->sourceItemsConfigurationProcessor->process(
$product->getSku(), $assignedSources);
execute(Observer $observer)
__construct(IsSourceItemManagementAllowedForProductTypeInterface $isSourceItemManagementAllowedForProductType, SourceItemsConfigurationProcessor $sourceItemsConfigurationProcessor, IsSingleSourceModeInterface $isSingleSourceMode, DefaultSourceProviderInterface $defaultSourceProvider)
const USE_CONFIG_NOTIFY_STOCK_QTY