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 @@ -648,8 +648,13 @@ protected function _initAttributes()
648
648
*/
649
649
protected function deleteOptionsAndSelections ($ productIds )
650
650
{
651
+ if (empty ($ productIds )) {
652
+ return $ this ;
653
+ }
654
+
651
655
$ optionTable = $ this ->_resource ->getTableName ('catalog_product_bundle_option ' );
652
656
$ optionValueTable = $ this ->_resource ->getTableName ('catalog_product_bundle_option_value ' );
657
+ $ selectionTable = $ this ->_resource ->getTableName ('catalog_product_bundle_selection ' );
653
658
$ valuesIds = $ this ->connection ->fetchAssoc ($ this ->connection ->select ()->from (
654
659
['bov ' => $ optionValueTable ],
655
660
['value_id ' ]
@@ -662,17 +667,16 @@ protected function deleteOptionsAndSelections($productIds)
662
667
$ productIds
663
668
));
664
669
$ this ->connection ->delete (
665
- $ optionTable ,
670
+ $ optionValueTable ,
666
671
$ this ->connection ->quoteInto ('value_id IN (?) ' , array_keys ($ valuesIds ))
667
672
);
668
- $ productIdsInWhere = $ this ->connection ->quoteInto ('parent_id IN (?) ' , $ productIds );
669
673
$ this ->connection ->delete (
670
674
$ optionTable ,
671
- $ this ->connection ->quoteInto ('parent_id IN (?) ' , $ productIdsInWhere )
675
+ $ this ->connection ->quoteInto ('parent_id IN (?) ' , $ productIds )
672
676
);
673
677
$ this ->connection ->delete (
674
- $ optionTable ,
675
- $ this ->connection ->quoteInto ('parent_product_id IN (?) ' , $ productIdsInWhere )
678
+ $ selectionTable ,
679
+ $ this ->connection ->quoteInto ('parent_product_id IN (?) ' , $ productIds )
676
680
);
677
681
return $ this ;
678
682
}
You can’t perform that action at this time.
0 commit comments