@@ -431,7 +431,10 @@ protected function _initMessageTemplates()
431
431
);
432
432
$ this ->_productEntity ->addMessageTemplate (
433
433
self ::ERROR_INVALID_TYPE ,
434
- __ ('Value for \'type \' sub attribute in \'custom_options \' attribute contains incorrect value, acceptable values are: \'dropdown \', \'checkbox \'' )
434
+ __ (
435
+ 'Value for \'type \' sub attribute in \'custom_options \' attribute contains incorrect value, acceptable values are: %1 ' ,
436
+ '\'' .implode ('\', \'' , array_keys ($ this ->_specificTypes )).'\''
437
+ )
435
438
);
436
439
$ this ->_productEntity ->addMessageTemplate (self ::ERROR_EMPTY_TITLE , __ ('Please enter a value for title. ' ));
437
440
$ this ->_productEntity ->addMessageTemplate (
@@ -629,7 +632,7 @@ public function validateAmbiguousData()
629
632
$ this ->_addRowsErrors (self ::ERROR_AMBIGUOUS_NEW_NAMES , $ errorRows );
630
633
return false ;
631
634
}
632
- if ($ this ->getBehavior () == \ Magento \ ImportExport \ Model \ Import::BEHAVIOR_APPEND ) {
635
+ if ($ this ->getBehavior () == Import::BEHAVIOR_APPEND ) {
633
636
$ errorRows = $ this ->_findOldOptionsWithTheSameTitles ();
634
637
if ($ errorRows ) {
635
638
$ this ->_addRowsErrors (self ::ERROR_AMBIGUOUS_OLD_NAMES , $ errorRows );
@@ -967,11 +970,10 @@ public function validateRow(array $rowData, $rowNumber)
967
970
return false ;
968
971
}
969
972
}
970
- return true ;
971
973
}
972
974
}
973
975
974
- return false ;
976
+ return true ;
975
977
}
976
978
977
979
/**
@@ -1381,7 +1383,7 @@ private function setLastOptionTitle(array &$titles) : void
1381
1383
*/
1382
1384
private function removeExistingOptions (array $ products , array $ optionsToRemove ): void
1383
1385
{
1384
- if ($ this ->getBehavior () != \ Magento \ ImportExport \ Model \ Import::BEHAVIOR_APPEND ) {
1386
+ if ($ this ->getBehavior () != Import::BEHAVIOR_APPEND ) {
1385
1387
$ this ->_deleteEntities (array_keys ($ products ));
1386
1388
} elseif (!empty ($ optionsToRemove )) {
1387
1389
// Remove options for products with empty "custom_options" row
@@ -2108,7 +2110,7 @@ private function savePreparedCustomOptions(
2108
2110
array $ types
2109
2111
): void {
2110
2112
if ($ this ->_isReadyForSaving ($ options , $ titles , $ types ['values ' ])) {
2111
- if ($ this ->getBehavior () == \ Magento \ ImportExport \ Model \ Import::BEHAVIOR_APPEND ) {
2113
+ if ($ this ->getBehavior () == Import::BEHAVIOR_APPEND ) {
2112
2114
$ this ->_compareOptionsWithExisting ($ options , $ titles , $ prices , $ types ['values ' ]);
2113
2115
$ this ->restoreOriginalOptionTypeIds ($ types ['values ' ], $ types ['prices ' ], $ types ['titles ' ]);
2114
2116
}
0 commit comments