Public Ticket #3074486

Bug Discount

Closed
Comments
4 Tickets 2
paola started the conversation 4 years ago on June 29, 2022 at 8:20am

Hi I’ve a big problem with price discount.

Your plugin truncate decimal price with 2 decimals and the total cart results wrong 

For example:
My product costs € 5,07 and I’ve 25% discount. The discounted price could be € 3,8025 and if I buy 500 pieces the total could be € 1901,25.

Your plugin make 25% discount with 2 decimals, so my product costs € 3,80.
3,80 * 500pieces = 1900.

How can I solve this bug?

I've tried to use a woocommerce coupon and it works correctly.

Thank you

2,762
KingsPlugins replied 4 years ago on June 29, 2022 at 12:36pm

Hi Paola,

Which version of the plugin do you have active


Please make sure that you are using B2BKing's latest plugin version, currently 4.1.97 on CodeCanyon. 

It may also help to add the following PHP code snippet to your site:

add_filter('b2bking_rounding_precision', function($val){
    return 4;
}, 10, 1);

Please check the above and let us know,


Kind regards,

Stefan

2,762
KingsPlugins replied 4 years ago on July 1, 2022 at 6:07pm

Thank you,

I've now applied a plugin update to your site and I believe this will work as desired now.

For example a test with showing 4 decimals:

1460072372.png


With 2 decimals:

7229590279.png


Kind regards,

Stefan

Sign In