Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

fixed discount rounding error (fix suggested)

$
0
0

Replies: 0

When using fixed discount – regarding the discounts displayed per item in the cart – the hundredths issue (floating point) is not showing when the hundredths position is a zero.

We were able to remedy this by modifying code at 256 and 347 of woocommerce-bulk-discount.php. The addition of number_format($coeff, 2) for the second to last mention of $coeff fixed the issue

$bulk_info = sprintf( __( ‘Incl. %s discount’, ‘wc_bulk_discount’ ), ( $discount_type == ‘flat’ || $discount_type == ‘fixed’ ? get_woocommerce_currency_symbol() . number_format($coeff, 2) : ( round( ( 1 – $coeff ) * 100, 2 ) . “%” ) ) );

Would it be possible to add this number_format($coeff, 2) in future releases of the plugin? Or would it negatively impact the plugin somehow.

Love the plugin – just wanted to suggest this tweak.


Viewing all articles
Browse latest Browse all 59525

Trending Articles