@@ -195,6 +195,8 @@ public function __construct(
195
195
}
196
196
197
197
/**
198
+ * Initialize template for error message.
199
+ *
198
200
* @param array $templateCollection
199
201
* @return $this
200
202
*/
@@ -377,6 +379,8 @@ public function retrieveAttributeFromCache($attributeCode)
377
379
}
378
380
379
381
/**
382
+ * Adding attribute option.
383
+ *
380
384
* In case we've dynamically added new attribute option during import we need to add it to our cache
381
385
* in order to keep it up to date.
382
386
*
@@ -508,8 +512,10 @@ public function isSuitable()
508
512
}
509
513
510
514
/**
511
- * Prepare attributes values for save: exclude non-existent, static or with empty values attributes;
512
- * set default values if needed
515
+ * Adding default attribute to product before save.
516
+ *
517
+ * Prepare attributes values for save: exclude non-existent, static or with empty values attributes,
518
+ * set default values if needed.
513
519
*
514
520
* @param array $rowData
515
521
* @param bool $withDefaultValue
@@ -537,9 +543,9 @@ public function prepareAttributesWithDefaultValueForSave(array $rowData, $withDe
537
543
} else {
538
544
$ resultAttrs [$ attrCode ] = $ rowData [$ attrCode ];
539
545
}
540
- } elseif (array_key_exists ($ attrCode , $ rowData )) {
546
+ } elseif (array_key_exists ($ attrCode , $ rowData ) && empty ( $ rowData [ ' _store ' ]) ) {
541
547
$ resultAttrs [$ attrCode ] = $ rowData [$ attrCode ];
542
- } elseif ($ withDefaultValue && null !== $ attrParams ['default_value ' ]) {
548
+ } elseif ($ withDefaultValue && null !== $ attrParams ['default_value ' ] && empty ( $ rowData [ ' _store ' ]) ) {
543
549
$ resultAttrs [$ attrCode ] = $ attrParams ['default_value ' ];
544
550
}
545
551
}
@@ -605,7 +611,8 @@ protected function getProductEntityLinkField()
605
611
}
606
612
607
613
/**
608
- * Clean cached values
614
+ * Clean cached values.
615
+ *
609
616
* @since 100.2.0
610
617
*/
611
618
public function __destruct ()
0 commit comments