Viewing 7 replies - 1 through 7 (of 7 total)
  • I have the same issue, but just by .01, so I am hoping there is a way to apply tax to the total instead of each product

    Plugin Author Inigo Gonzalez

    (@inigoini)

    Hi,

    I’m going to take a look, but

    Could you test setting decimals to 3? (TheCartPress Settings / Localize)

    Best regards

    If I change the Settings > Localize, the product prices become $9.000, not the tax, but when I change it in the TCP.cartbox.class.php, the tax will show 8.250% which is correct, but the total tax calculations are still off by .01 cent.

    TCP.cartbox.class.php line:
    <?php if ( $see_tax_detail ) : ?> (<?php echo tcp_number_format( $tax, 3 ); ?>%)<?php endif; ?>

    For example, if I add 2 units of Jasmine Dragon Pearl tea. Which makes the subtotal $20 (since each unit is $10), the tax calculated for 8.25% is .83 per unit in cart, so the total tax applied is $1.66.

    BUT, if you calculate it manually $20 x 0.825 = $1.65. So the tax applied is supposed to be $1.65. Per product, customer will be charged 1 cent more.

    It seems not much off, but if you buy many units of products, .01 added to each unit adds up and a penny saved is a penny earned.

    You can test it in the cart.
    https://www.wonderfultealifeusa.com/flower-teas/

    That’s why I suggest applying tax to the total instead of each product. Normally, receipts apply tax to totals, not per unit here.

    Plugin Author Inigo Gonzalez

    (@inigoini)

    Hi Carol,

    There is another line of code 225 and 26 where the rounded is applied.

    225: $tax_amount_per_unit = round( $tax_amount_per_unit, $decimals );
    226: $tax_amount = round( $tax_amount_per_unit * $item->getUnits(), $decimals );

    The line <?php if ( $see_tax_detail ) : ?> (<?php echo tcp_number_format( $tax, 3 ); ?>%)<?php endif; ?> is only to display the tax value.

    if you do not want to lose your changes you can create a plugin with your checkout step: https://thecartpress.com/docs/developer-docs/plugin-development/how-to-create-a-checkout-step-or-box/

    Best regards

    I changed it back to 2 since we want to entire tax rate (including two decimals) to show 8.25%.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Rounding Tax, can it be stopped?’ is closed to new replies.