diff --git a/vendor/magento/module-catalog-import-export/Model/Import/Product.php b/vendor/magento/module-catalog-import-export/Model/Import/Product.php index 425d1309bd4..962e0f75419 100644 --- a/vendor/magento/module-catalog-import-export/Model/Import/Product.php +++ b/vendor/magento/module-catalog-import-export/Model/Import/Product.php @@ -170,8 +170,6 @@ class Product extends AbstractEntity const URL_KEY = 'url_key'; /** - * Attribute cache - * * @var array */ protected $_attributeCache = []; @@ -237,8 +235,6 @@ class Product extends AbstractEntity ]; /** - * Attributes codes which shows as date - * * @var array * @since 100.1.2 */ @@ -252,8 +248,6 @@ class Product extends AbstractEntity ]; /** - * Need to log in import history - * * @var bool */ protected $logInHistory = true; @@ -266,8 +260,6 @@ class Product extends AbstractEntity protected $_mediaGalleryAttributeId = null; /** - * Validation failure message template definitions - * * @var array * @codingStandardsIgnoreStart */ @@ -649,7 +641,7 @@ class Product extends AbstractEntity private $_logger; /** - * {@inheritdoc} + * @var string */ protected $masterAttributeCode = 'sku'; @@ -690,15 +682,11 @@ class Product extends AbstractEntity protected $rowNumbers = []; /** - * Product entity link field - * * @var string */ private $productEntityLinkField; /** - * Product entity identifier field - * * @var string */ private $productEntityIdentifierField; @@ -725,8 +713,6 @@ class Product extends AbstractEntity private $catalogConfig; /** - * Stock Item Importer - * * @var StockItemImporterInterface */ private $stockItemImporter; @@ -3167,10 +3153,6 @@ class Product extends AbstractEntity $stockItemDo = $this->stockRegistry->getStockItem($row['product_id'], $row['website_id']); $existStockData = $stockItemDo->getData(); - if (isset($rowData['qty']) && $rowData['qty'] == 0 && !isset($rowData['is_in_stock'])) { - $rowData['is_in_stock'] = 0; - } - $row = array_merge( $this->defaultStockData, array_intersect_key($existStockData, $this->defaultStockData), @@ -3179,11 +3161,10 @@ class Product extends AbstractEntity ); if ($this->stockConfiguration->isQty($this->skuProcessor->getNewSku($sku)['type_id'])) { - if (isset($rowData['qty']) && $rowData['qty'] == 0) { - $row['is_in_stock'] = 0; - } $stockItemDo->setData($row); - $row['is_in_stock'] = $row['is_in_stock'] ?? $this->stockStateProvider->verifyStock($stockItemDo); + $row['is_in_stock'] = $this->stockStateProvider->verifyStock($stockItemDo) + ? (int) $row['is_in_stock'] + : 0; if ($this->stockStateProvider->verifyNotification($stockItemDo)) { $date = $this->dateTimeFactory->create('now', new \DateTimeZone('UTC')); $row['low_stock_date'] = $date->format(DateTime::DATETIME_PHP_FORMAT);