Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2636,7 +2636,10 @@ private function _setStockUseConfigFieldsValues($rowData)
{
$useConfigFields = [];
foreach ($rowData as $key => $value) {
$useConfigName = self::INVENTORY_USE_CONFIG_PREFIX . $key;
$useConfigName = $key === 'enable_qty_increments'
? 'use_config_enable_qty_inc'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using the static definition instead of the hardcoded 'enable_qty_increments' value.

Magento\CatalogInventory\Api\Data\StockItemInterface::ENABLE_QTY_INCREMENTS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for suggestion, it makes sense.
I thought about it, but ignored in favor of consistency, e.g. \Magento\CatalogImportExport\Model\Import\Product::$defaultStockData doesn't use constants etc.

Any way, suggested changes were implemented.

: self::INVENTORY_USE_CONFIG_PREFIX . $key;

if (isset($this->defaultStockData[$key])
&& isset($this->defaultStockData[$useConfigName])
&& !empty($value)
Expand Down