hi
I have a store Woocommerce and I use the plugin Woocommerce Custom Product Addons
https://wordpress.org/plugins/woo-custom-product-addons/
Where I select product options and link them together with custom pricing and formulas
The problem and the question is that after selecting these options, the total price appears to be an incorrect number, for example 20.01 This is normal due to custom pricing I just want the total on the product page to be rounded to the nearest whole number. Like 20.00

I talked to the plugin developer and gave me a file + image and in fact I have no experience how to fix it

https://mzeeg.com/wp-content/uploads/2020/06/image.png

File link
https://mzeeg.com/wp-content/uploads/2020/06/frontend.js.zip

Tell me that this file is brief on the site, and after modifying it, it will be shortened

thank you

    First of all, this looks like it's in JavaScript, not PHP, so mentioning the round function isn't going to help much.
    Secondly, this looks like the prices and calculations are all done in floating-point, which is a Bad Idea; for one thing, it can lead to rounding errors.

      20 days later
      Write a Reply...