File tree 1 file changed +9
-5
lines changed
app/code/Magento/BundleImportExport/Model/Import/Product/Type 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -629,8 +629,13 @@ protected function _initAttributes()
629
629
*/
630
630
protected function deleteOptionsAndSelections ($ productIds )
631
631
{
632
+ if (empty ($ productIds )) {
633
+ return $ this ;
634
+ }
635
+
632
636
$ optionTable = $ this ->_resource ->getTableName ('catalog_product_bundle_option ' );
633
637
$ optionValueTable = $ this ->_resource ->getTableName ('catalog_product_bundle_option_value ' );
638
+ $ selectionTable = $ this ->_resource ->getTableName ('catalog_product_bundle_selection ' );
634
639
$ valuesIds = $ this ->connection ->fetchAssoc ($ this ->connection ->select ()->from (
635
640
['bov ' => $ optionValueTable ],
636
641
['value_id ' ]
@@ -643,17 +648,16 @@ protected function deleteOptionsAndSelections($productIds)
643
648
$ productIds
644
649
));
645
650
$ this ->connection ->delete (
646
- $ optionTable ,
651
+ $ optionValueTable ,
647
652
$ this ->connection ->quoteInto ('value_id IN (?) ' , array_keys ($ valuesIds ))
648
653
);
649
- $ productIdsInWhere = $ this ->connection ->quoteInto ('parent_id IN (?) ' , $ productIds );
650
654
$ this ->connection ->delete (
651
655
$ optionTable ,
652
- $ this ->connection ->quoteInto ('parent_id IN (?) ' , $ productIdsInWhere )
656
+ $ this ->connection ->quoteInto ('parent_id IN (?) ' , $ productIds )
653
657
);
654
658
$ this ->connection ->delete (
655
- $ optionTable ,
656
- $ this ->connection ->quoteInto ('parent_product_id IN (?) ' , $ productIdsInWhere )
659
+ $ selectionTable ,
660
+ $ this ->connection ->quoteInto ('parent_product_id IN (?) ' , $ productIds )
657
661
);
658
662
return $ this ;
659
663
}
You can’t perform that action at this time.
0 commit comments