diff --git a/vendor/magento/module-configurable-import-export/Model/Import/Product/Type/Configurable.php b/vendor/magento/module-configurable-import-export/Model/Import/Product/Type/Configurable.php index 88007d0b1a8..f0f8bfe4936 100644 --- a/vendor/magento/module-configurable-import-export/Model/Import/Product/Type/Configurable.php +++ b/vendor/magento/module-configurable-import-export/Model/Import/Product/Type/Configurable.php @@ -159,6 +159,7 @@ class Configurable extends \Magento\CatalogImportExport\Model\Import\Product\Typ * * @var \Magento\Framework\DB\Adapter\AdapterInterface * @deprecated 100.2.0 + * @see No longer used */ protected $_connection; @@ -573,6 +574,18 @@ class Configurable extends \Magento\CatalogImportExport\Model\Import\Product\Typ $fieldAndValuePairs = []; foreach ($fieldAndValuePairsText as $nameAndValue) { + // If field value contains comma. For example: sku=C100-10,2cm,size=10,2cm + // then this results in $fieldAndValuePairsText = ["sku=C100-10", "2cm", "size=10", "2cm"] + // This code block makes sure that the array element that do not contain the equal sign "=" + // will be appended to the preceding element value. + // As a result $fieldAndValuePairs = ["sku" => "C100-10,2cm", "size" => "10,2cm"] + if (strpos($nameAndValue, ImportProduct::PAIR_NAME_VALUE_SEPARATOR) === false + && isset($fieldName) + && isset($fieldAndValuePairs[$fieldName]) + ) { + $fieldAndValuePairs[$fieldName] .= $this->_entityModel->getMultipleValueSeparator() . $nameAndValue; + continue; + } $nameAndValue = explode(ImportProduct::PAIR_NAME_VALUE_SEPARATOR, $nameAndValue, 2); if (!empty($nameAndValue)) { $value = isset($nameAndValue[1]) ? trim($nameAndValue[1]) : '';