File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -399,12 +399,11 @@ public function modifyData(array $data)
399399
400400 foreach ($ attributes as $ attribute ) {
401401 if (null !== ($ attributeValue = $ this ->setupAttributeData ($ attribute ))) {
402- if ($ attribute ->getFrontendInput () === 'price ' && is_scalar ($ attributeValue )) {
403- if ($ this ->locator ->getProduct ()->getTypeId () !== ProductType::TYPE_BUNDLE
404- || $ attribute ->getAttributeCode () !== ProductAttributeInterface::CODE_SPECIAL_PRICE
405- ) {
406- $ attributeValue = $ this ->formatPrice ($ attributeValue );
407- }
402+ if ($ attribute ->getFrontendInput () === 'price '
403+ && is_scalar ($ attributeValue )
404+ && !$ this ->isBundleSpecialPrice ($ attribute )
405+ ) {
406+ $ attributeValue = $ this ->formatPrice ($ attributeValue );
408407 }
409408 $ data [$ productId ][self ::DATA_SOURCE_DEFAULT ][$ attribute ->getAttributeCode ()] = $ attributeValue ;
410409 }
@@ -414,6 +413,18 @@ public function modifyData(array $data)
414413 return $ data ;
415414 }
416415
416+ /**
417+ * Obtain if current product is bundle and given attribute is special_price
418+ *
419+ * @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute
420+ * @return bool
421+ */
422+ private function isBundleSpecialPrice (ProductAttributeInterface $ attribute )
423+ {
424+ return $ this ->locator ->getProduct ()->getTypeId () === ProductType::TYPE_BUNDLE
425+ && $ attribute ->getAttributeCode () === ProductAttributeInterface::CODE_SPECIAL_PRICE ;
426+ }
427+
417428 /**
418429 * Resolve data persistence
419430 *
You can’t perform that action at this time.
0 commit comments