Get discount price of product without considering cart item quantity
Retrieve the discount price of a product regardless of cart item quantity.
add_filter('advanced_woo_discount_rules_cart_item_quantity', function ($cart_item_quantity){
global $awdr_temp_qty_cal;
if($awdr_temp_qty_cal === true) $cart_item_quantity = 0;
return $cart_item_quantity;
});
add_action('woocommerce_before_add_to_cart_form', function (){
global $awdr_temp_qty_cal;
$awdr_temp_qty_cal = true;
global $product;
$discount = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', 0, $product, 1, $product->get_price(), 'discounted_price', true, false);
if($discount !== false){
//$discount -> Here we get discount amount
}
$awdr_temp_qty_cal = false;
});