diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php index 17c0d0836121a..f944bcfe26c2c 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php @@ -361,4 +361,29 @@ private function joinProductsToLinks() ); } } + + /** + * After the collection has been loaded + * + * @SuppressWarnings(PHPMD.CamelCaseMethodName) + * @return $this + */ + protected function _afterLoad() + { + if ($this->getLinkModel()) { + $attributes = $this->getLinkAttributes(); + foreach ($this as $item) { + foreach ($attributes as $attribute) { + $code = $attribute['code']; + $value = $item->getData($code); + if ($value !== null) { + if ($attribute['type'] == 'decimal') { + $item->setData($code, (float)$value); + } + } + } + } + } + return parent::_afterLoad(); + } }