vendredi 10 juin 2016

How to round price after applying coupon in WooCommerce?

I've addded the below code to my function.php, but it didn't round the price after applying a coupon.

I'm using woocommerce 2.5.5.

This is my code:

add_filter( 'woocommerce_get_price_excluding_tax', 'round_price_product', 10, 1 );
add_filter( 'woocommerce_get_price_including_tax', 'round_price_product', 10, 1 );
add_filter( 'woocommerce_tax_round', 'round_price_product', 10, 1);
add_filter( 'woocommerce_get_price', 'round_price_product', 10, 1);

function round_price_product( $price ){
    // Return rounded price
    return round( $price );
}

What is wrong?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire