File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
app/code/Magento/Bundle/Model/Product Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -95,12 +95,14 @@ public function execute($entity, $arguments = [])
9595 {
9696 /** @var OptionInterface[] $bundleProductOptions */
9797 $ bundleProductOptions = $ entity ->getExtensionAttributes ()->getBundleProductOptions () ?: [];
98+ $ existingBundleProductOptions = $ this ->optionRepository ->getList ($ entity ->getSku ());
9899 //Only processing bundle products.
99- if ($ entity ->getTypeId () !== Type::TYPE_CODE || empty ($ bundleProductOptions )) {
100+ if ($ entity ->getTypeId () !== Type::TYPE_CODE ||
101+ (empty ($ bundleProductOptions ) && empty ($ existingBundleProductOptions ))
102+ ) {
100103 return $ entity ;
101104 }
102105
103- $ existingBundleProductOptions = $ this ->optionRepository ->getList ($ entity ->getSku ());
104106 $ existingOptionsIds = !empty ($ existingBundleProductOptions )
105107 ? $ this ->getOptionIds ($ existingBundleProductOptions )
106108 : [];
You can’t perform that action at this time.
0 commit comments