Skip to content

Commit 73e9343

Browse files
committed
magento-engcom/import-export-improvements#49: Add removal of custom options via csv via constant
1 parent c07aea8 commit 73e9343

File tree

1 file changed

+7
-1
lines changed
  • app/code/Magento/CatalogImportExport/Model/Import/Product

1 file changed

+7
-1
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,13 @@ protected function _importData()
12361236
$multiRowData = $this->_getMultiRowFormat($rowData);
12371237
if (!empty($rowData[self::COLUMN_SKU]) && isset($this->_productsSkuToId[$rowData[self::COLUMN_SKU]])) {
12381238
$this->_rowProductId = $this->_productsSkuToId[$rowData[self::COLUMN_SKU]];
1239-
if (array_key_exists('custom_options', $rowData) && trim($rowData['custom_options']) === '') {
1239+
if (
1240+
array_key_exists('custom_options', $rowData)
1241+
&& (
1242+
trim($rowData['custom_options']) === ''
1243+
|| trim ($rowData['custom_options']) === $this->_productEntity->getEmptyAttributeValueConstant()
1244+
)
1245+
) {
12401246
$optionsToRemove[] = $this->_rowProductId;
12411247
}
12421248
}

0 commit comments

Comments
 (0)