Skip to content

Commit 0fe06aa

Browse files
committed
MAGETWO-50605: Tier pricing is not validated against product special price
1 parent 7200766 commit 0fe06aa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ protected function filterTierPrices(array $priceList)
162162
$qtyCache = [];
163163
$allCustomersGroupId = $this->groupManagement->getAllCustomersGroup()->getId();
164164
foreach ($priceList as $priceKey => &$price) {
165+
if ($price['price'] >= $this->priceInfo->getPrice(FinalPrice::PRICE_CODE)->getValue()) {
166+
unset($priceList[$priceKey]);
167+
continue;
168+
}
169+
165170
if (isset($price['price_qty']) && $price['price_qty'] == 1) {
166171
unset($priceList[$priceKey]);
167172
continue;
@@ -204,7 +209,7 @@ protected function getBasePrice()
204209
public function getSavePercent(AmountInterface $amount)
205210
{
206211
return ceil(
207-
100 - ((100 / $this->priceInfo->getPrice(RegularPrice::PRICE_CODE)->getAmount()->getBaseAmount())
212+
100 - ((100 / $this->priceInfo->getPrice(FinalPrice::PRICE_CODE)->getValue())
208213
* $amount->getBaseAmount())
209214
);
210215
}

0 commit comments

Comments
 (0)