I’m using an extension plugin to WooCommerce which lets me customize bulk discount prices.
With that, I need very specific pricings, like $4.23333333333 but the problem is, WooCommerce rounds, I think, two the hundreth, and ignores the rest of the value. Is there a way to change this?
I’ve tried editing woocommerce.php
define( 'WC_ROUNDING_PRECISION', 4 );
And changing the four value to other numbers, but it doesn’t seem to change the subtotal/total.
Under WooCommerce > Settings > General, there is an option for number of decimals.
Also, do not edit WooCommerce core code. Define the constant in your own site-specific snippets plugin.
Edit
If you only want the option to change in certain places, I think we can filter the
get_option()
value. As a start the following should change the option value when we’re on the cart page. But keep in mind that I haven’t tested it, so no guarantees.This is resulting in the following in the cart:
You might still need the precision rounding constant you originally pointed out on in your question. I’m not really sure since my price is rounded to the whole dollar.