get the discount price programmatically in WordPress woo-commerce

Add the following code in your php code file: get the discount price programmatically in WordPress woo-commerceexpoundsofttechsolution get the discount price programmatically in WordPress woo-commerce
function remove_currency($price) {
    return (double) preg_replace('/[^0-9\.]+/', '', $price);
}

$totalprice = remove_currency($woocommerce->cart->get_cart_subtotal());
$totaldiscountprice = remove_currency($woocommerce->cart->get_total_discount());
$resultprice = $totalprice - $totaldiscountprice ;

echo $resultprice ;