Solution:
Magento2 ver. 2.1.5, 2.1.7
Going to 'vendor/magento/module-catalog/Pricing/Price/TierPrice.php
Line No 209
public function getSavePercent(AmountInterface $amount)
{
return ceil(
100 - ((100 / $this->priceInfo->getPrice(FinalPrice::PRICE_CODE)->getValue())
* $amount->getBaseAmount())
);
}
Replace to :
public function getSavePercent(AmountInterface $amount)
{
/*return ceil(
100 - ((100 / $this->priceInfo->getPrice(FinalPrice::PRICE_CODE)->getValue())
* $amount->getBaseAmount())
);*/
$productPriceAmount = $this->priceInfo->getPrice(
FinalPrice::PRICE_CODE
)->getAmount();
return round(
100 - ((100 / $productPriceAmount->getValue()) * $amount->getValue())
);
}
Magento2 ver. 2.1.5, 2.1.7
Going to 'vendor/magento/module-catalog/Pricing/Price/TierPrice.php
Line No 209
public function getSavePercent(AmountInterface $amount)
{
return ceil(
100 - ((100 / $this->priceInfo->getPrice(FinalPrice::PRICE_CODE)->getValue())
* $amount->getBaseAmount())
);
}
Replace to :
public function getSavePercent(AmountInterface $amount)
{
/*return ceil(
100 - ((100 / $this->priceInfo->getPrice(FinalPrice::PRICE_CODE)->getValue())
* $amount->getBaseAmount())
);*/
$productPriceAmount = $this->priceInfo->getPrice(
FinalPrice::PRICE_CODE
)->getAmount();
return round(
100 - ((100 / $productPriceAmount->getValue()) * $amount->getValue())
);
}
No comments:
Post a Comment