I m working on ../Magento_Catalog/templates/product/list.phtml. I already write onsale label for products like this;
<span class="onsale">
<span>
<?php
$label_price=$_product->getPrice();
$final_price=$_product->getSpecialPrice();
$save_percent = 100 - round(($final_price / $label_price)*100);
echo $save_percent.'% Off';?>
</span>
</span>
Its working perfect for Simple product but its not working for configurable products, I know configurable products doesn't have price but how can I get configurable first child product price or get price which is show as default price.