File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -317,12 +317,14 @@ public function mergeProductOptions($productOptions, $overwriteOptions)
317
317
318
318
foreach ($ productOptions as $ index => $ option ) {
319
319
$ optionId = $ option ['option_id ' ];
320
-
321
- if (isset ($ overwriteOptions [$ optionId ])) {
322
- foreach ($ overwriteOptions [$ optionId ] as $ fieldName => $ overwrite ) {
323
- if (!empty ($ overwrite ) && isset ($ option [$ fieldName ]) && isset ($ option ['default_ ' . $ fieldName ])) {
324
- $ productOptions [$ index ][$ fieldName ] = $ option ['default_ ' . $ fieldName ];
325
- }
320
+
321
+ if (!isset ($ overwriteOptions [$ optionId ])) {
322
+ continue ;
323
+ }
324
+
325
+ foreach ($ overwriteOptions [$ optionId ] as $ fieldName => $ overwrite ) {
326
+ if ($ overwrite && isset ($ option [$ fieldName ]) && isset ($ option ['default_ ' . $ fieldName ])) {
327
+ $ productOptions [$ index ][$ fieldName ] = $ option ['default_ ' . $ fieldName ];
326
328
}
327
329
}
328
330
}
You can’t perform that action at this time.
0 commit comments