Percentage Based Coupon Round Figure Issue Fix In Woocommerce

Share Now

#Add this code in functions.php

add_filter( 'woocommerce_coupon_get_discount_amount', 'filter_woocommerce_coupon_get_discount_amount', 10, 5 );
function filter_woocommerce_coupon_get_discount_amount( $discount, $discounting_amount, $cart_item, $single, $instance ) {
    // Round the discount for all other coupon types than 'fixed_cart'
    if( ! $instance->is_type('fixed_cart') )
        $discount = ceil( $discount );

    return $discount; 
} 
Picture of Nahid Mahamud

Nahid Mahamud

Web Developer | Graphic Designer | WordPress & Woo-commerce Expert