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 = [])
95
95
{
96
96
/** @var OptionInterface[] $bundleProductOptions */
97
97
$ bundleProductOptions = $ entity ->getExtensionAttributes ()->getBundleProductOptions () ?: [];
98
+ $ existingBundleProductOptions = $ this ->optionRepository ->getList ($ entity ->getSku ());
98
99
//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
+ ) {
100
103
return $ entity ;
101
104
}
102
105
103
- $ existingBundleProductOptions = $ this ->optionRepository ->getList ($ entity ->getSku ());
104
106
$ existingOptionsIds = !empty ($ existingBundleProductOptions )
105
107
? $ this ->getOptionIds ($ existingBundleProductOptions )
106
108
: [];
You can’t perform that action at this time.
0 commit comments