I overridden module-catalog/product/price/amount/default.phtml file in my theme
<?php
echo $this->helper('Test\ProductDetail\Helper\Data')->DisplayDiscountLabel($_product);
?>
In helper file I have following code ;
namespace Test\ProductDetail\Helper;
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
public function DisplayDiscountLabel($_product)
{
$originalPrice = $_product->getPrice();
$finalPrice = $_product->getFinalPrice();
$percentage = 0;
if ($originalPrice > $finalPrice) {
$percentage = number_format(($originalPrice - $finalPrice) * 100 / $originalPrice,0);
}
if ($percentage) {
return "(".$percentage."%)";
}
}
}
but problem is that in phtml file I am not getting value of $_product?