Skip to content

Commit a0a08d1

Browse files
author
Oleksii Korshenko
committed
MAGETWO-67509: Decimal to Float Convertion #9266
- reverted original fix due to broken logic in other parts or the system - added local fix for Tier Price
1 parent 7049df8 commit a0a08d1

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -362,29 +362,4 @@ private function joinProductsToLinks()
362362
);
363363
}
364364
}
365-
366-
/**
367-
* After the collection has been loaded
368-
*
369-
* @SuppressWarnings(PHPMD.CamelCaseMethodName)
370-
* @return $this
371-
*/
372-
protected function _afterLoad()
373-
{
374-
if ($this->getLinkModel()) {
375-
$attributes = $this->getLinkAttributes();
376-
foreach ($this as $item) {
377-
foreach ($attributes as $attribute) {
378-
$code = $attribute['code'];
379-
$value = $item->getData($code);
380-
if ($value !== null) {
381-
if ($attribute['type'] == 'decimal') {
382-
$item->setData($code, (float)$value);
383-
}
384-
}
385-
}
386-
}
387-
}
388-
return parent::_afterLoad();
389-
}
390365
}

app/code/Magento/Catalog/Pricing/Price/TierPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct(
7272
Session $customerSession,
7373
GroupManagementInterface $groupManagement
7474
) {
75-
$quantity = $quantity ?: 1;
75+
$quantity = floatval($quantity) ? $quantity : 1;
7676
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
7777
$this->customerSession = $customerSession;
7878
$this->groupManagement = $groupManagement;

0 commit comments

Comments
 (0)