6 declare(strict_types=1);
26 private $isSingleSourceMode;
36 private $getQuantityInformationPerSourceBySkus;
48 $this->isSingleSourceMode = $isSingleSourceMode;
49 $this->locator = $locator;
50 $this->getQuantityInformationPerSourceBySkus = $getQuantityInformationPerSourceBySkus;
61 $product = $this->locator->getProduct();
64 if (
$product->getTypeId() === GroupedProductType::TYPE_CODE
67 && !$this->isSingleSourceMode->execute()
75 $sourceItemsData = $this->getQuantityInformationPerSourceBySkus->execute($linkSkus);
78 $productLinkData[
'quantity_per_source'] = $sourceItemsData[$productLinkData[
'sku']] ?? [];
93 if ($this->locator->getProduct()->getTypeId() === GroupedProductType::TYPE_CODE
94 && !$this->isSingleSourceMode->execute()
96 $meta = array_replace_recursive($meta, [
106 'config' => $this->getQuantityPerSourceConfig()
117 'quantity_per_source' =>
'quantity_per_source' 136 private function getQuantityPerSourceConfig(): array
139 'componentType' =>
'text',
140 'component' =>
'Magento_InventoryGroupedProductAdminUi/js/form/element/quantity-per-source',
141 'template' =>
'ui/form/field',
142 'dataScope' =>
'quantity_per_source',
143 'label' =>
__(
'Quantity Per Source'),
__construct(IsSingleSourceModeInterface $isSingleSourceMode, LocatorInterface $locator, GetQuantityInformationPerSourceBySkus $getQuantityInformationPerSourceBySkus)