The sales-badge and regular price disappears when i’m using this piece of code in my functions.php file. I have tried ith with other themes and it seems to work, but not with Xstore
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 );
}
The reason i want to use this code is that many transaction services (PayEx, Stripe.. etc) gives error on prices with 3 desimals. So when I i.e. run “whole store sale for 15%” some prices are automacally calculated to 3 desimals, like “145.612”. I want to round this price to “145.00” to avoid any issues with the creditcard service.
Anyone know any solution?