• Resolved fjpcoelho

    (@fjpcoelho)


    Hi,

    I’m having an issue when I try to buy two products of 10.50€. It also charge 20,99€ and not 21,00€. Can you help me on this?

    I tried to use a custom code to fix the problem. In fact, it corrects the value that it presents but does not correct the amount charged.
    This is the code:

    // Round price for .99 .01 decimals
    add_filter( ‘raw_woocommerce_price’, function ( $price ) {
    $decimals = round( $price – floor( $price ), 2 );

    return ( $decimals == 0.01 || $decimals == 0.99 ) ? round( $price ) : $price;
    } );

    I’m out of solutions…

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    This probably works better when hooked into woocommerce_after_calculate_totals.
    I am marking this as resolved, but feel free to follow up or open a new thread anytime.

    Kind regards,

Viewing 1 replies (of 1 total)
  • The topic ‘1 cent error calculation’ is closed to new replies.