• Resolved fixait

    (@fixait)


    Hi,

    after installing the plugin, the round of the cart does not work for me. I am using this simple code:

    add_filter( 'woocommerce_calculated_total', 'custom_calculated_total' );
    function custom_calculated_total( $total ) {
    	$total = round($total);
    	return ceil($total);
    }

    How to fix this in the plugin or code to make the rounding work?
    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author algol.plus

    (@algolplus)

    hello

    please, add this code too.

    add_action("woocommerce_after_calculate_totals", function ($wcCart) {
    $wcNoFilterWorker = new \ADP\BaseVersion\Includes\WC\WcNoFilterWorker();
    $wcNoFilterWorker->calculateTotals($wcCart, $wcNoFilterWorker::FLAG_ALLOW_TOTALS_HOOKS);
    }, PHP_INT_MAX, 1);
    add_filter('wdp_calculate_totals_hook_priority', function($priority){return PHP_INT_MAX - 1;});

    Thread Starter fixait

    (@fixait)

    Hi

    it’s work! Thanks

    Plugin Author algol.plus

    (@algolplus)

    You’re welcome

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Round total not work’ is closed to new replies.