File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -399,10 +399,7 @@ public function modifyData(array $data)
399399
400400 foreach ($ attributes as $ attribute ) {
401401 if (null !== ($ attributeValue = $ this ->setupAttributeData ($ attribute ))) {
402- if ($ attribute ->getFrontendInput () === 'price '
403- && is_scalar ($ attributeValue )
404- && !$ this ->isBundleSpecialPrice ($ attribute )
405- ) {
402+ if ($ this ->isPriceAttribute ($ attribute , $ attributeValue )) {
406403 $ attributeValue = $ this ->formatPrice ($ attributeValue );
407404 }
408405 $ data [$ productId ][self ::DATA_SOURCE_DEFAULT ][$ attribute ->getAttributeCode ()] = $ attributeValue ;
@@ -413,6 +410,20 @@ public function modifyData(array $data)
413410 return $ data ;
414411 }
415412
413+ /**
414+ * Obtain if given attribute is a price
415+ *
416+ * @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute
417+ * @param string|integer $attributeValue
418+ * @return bool
419+ */
420+ private function isPriceAttribute (ProductAttributeInterface $ attribute , $ attributeValue )
421+ {
422+ return $ attribute ->getFrontendInput () === 'price '
423+ && is_scalar ($ attributeValue )
424+ && !$ this ->isBundleSpecialPrice ($ attribute );
425+ }
426+
416427 /**
417428 * Obtain if current product is bundle and given attribute is special_price
418429 *
You can’t perform that action at this time.
0 commit comments