@@ -1235,7 +1235,7 @@ protected function _importData()
1235
1235
$ multiRowData = $ this ->_getMultiRowFormat ($ rowData );
1236
1236
if (!empty ($ rowData [self ::COLUMN_SKU ]) && isset ($ this ->_productsSkuToId [$ rowData [self ::COLUMN_SKU ]])) {
1237
1237
$ this ->_rowProductId = $ this ->_productsSkuToId [$ rowData [self ::COLUMN_SKU ]];
1238
- if (array_key_exists ('custom_options ' , $ rowData ) && trim ($ rowData ['custom_options ' ]) === "" ) {
1238
+ if (array_key_exists ('custom_options ' , $ rowData ) && trim ($ rowData ['custom_options ' ]) === '' ) {
1239
1239
$ optionsToRemove [] = $ this ->_rowProductId ;
1240
1240
}
1241
1241
}
@@ -1273,15 +1273,18 @@ protected function _importData()
1273
1273
1274
1274
$ this ->removeExistingOptions ($ products , $ optionsToRemove );
1275
1275
1276
+ $ types = [
1277
+ 'values ' => $ typeValues ,
1278
+ 'prices ' => $ typePrices ,
1279
+ 'titles ' => $ typeTitles ,
1280
+ ];
1276
1281
//Save prepared custom options data.
1277
1282
$ this ->savePreparedCustomOptions (
1278
1283
$ products ,
1279
1284
$ options ,
1280
1285
$ titles ,
1281
1286
$ prices ,
1282
- $ typeValues ,
1283
- $ typePrices ,
1284
- $ typeTitles
1287
+ $ types
1285
1288
);
1286
1289
}
1287
1290
@@ -1546,7 +1549,7 @@ private function getExistingOptionTypeId($optionId, $storeId, $optionTypeTitle)
1546
1549
*/
1547
1550
protected function _parseRequiredData (array $ rowData )
1548
1551
{
1549
- if (! isset ( $ this ->_rowProductId ) ) {
1552
+ if ($ this ->_rowProductId === null ) {
1550
1553
return false ;
1551
1554
}
1552
1555
@@ -2006,9 +2009,7 @@ private function getProductIdentifierField()
2006
2009
* @param array $options
2007
2010
* @param array $titles
2008
2011
* @param array $prices
2009
- * @param array $typeValues
2010
- * @param array $typePrices
2011
- * @param array $typeTitles
2012
+ * @param array $types
2012
2013
*
2013
2014
* @return void
2014
2015
*/
@@ -2017,16 +2018,9 @@ private function savePreparedCustomOptions(
2017
2018
array $ options ,
2018
2019
array $ titles ,
2019
2020
array $ prices ,
2020
- array $ typeValues ,
2021
- array $ typePrices ,
2022
- array $ typeTitles
2021
+ array $ types
2023
2022
): void {
2024
- if ($ this ->_isReadyForSaving ($ options , $ titles , $ typeValues )) {
2025
- $ types = [
2026
- 'values ' => $ typeValues ,
2027
- 'prices ' => $ typePrices ,
2028
- 'titles ' => $ typeTitles ,
2029
- ];
2023
+ if ($ this ->_isReadyForSaving ($ options , $ titles , $ types ['values ' ])) {
2030
2024
if ($ this ->getBehavior () == \Magento \ImportExport \Model \Import::BEHAVIOR_APPEND ) {
2031
2025
$ this ->_compareOptionsWithExisting ($ options , $ titles , $ prices , $ types ['values ' ]);
2032
2026
$ this ->restoreOriginalOptionTypeIds ($ types ['values ' ], $ types ['prices ' ], $ types ['titles ' ]);
0 commit comments