• coadr93

    (@coadr93)


    Hi. So I have a bundle which is 3 X the same product.

    I do it like this so I can display pack of 3 in feeds for ads, but also send to the fulfillment company 3 quantity of the same SKU instead of different products.

    Problem is my price is 99 and the pack of 3 is 275. This means the discount is around 7.4%.

    But it results in a 91.66 price which is then multiplied by 3 and the final price is 274.98 instead of 275.

    I tried rounding the price via a function I found online, but the data is sent through API to the fulfilment software, and although in my site it shows as 275, the API sends it as 274.98.

    Can you help me round the total price of percentage discounts so it shows something like 91.66 * 3 = 275?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Janilyn T

    (@janilyn409)

    Hi @coadr93 ,

    Which discount method have you used for your bundle? Since your bundle includes fixed quantity of subproducts, you can disable the Auto-price and enter the 275 price in the Sale price box of the General tab of your bundle page to offer 3 x product A at $275. Then you won’t have to worry about the rounding prices anymore.

    If you use the auto-price, our plugin will use the rounding rules configured under WooCommerce >>Settings section of your site.

    However, I should warn in advance that our plugin doesn’t work with the REST API properly, so if you use the auto-price for your bundles, only the percentage discount can work.

    Best regards.

    Thread Starter coadr93

    (@coadr93)

    Hi. Thanks for the response. I can’t disable the Auto pricing because that will result in 1 x SKU3bundle instead of 3 x SKUmainsingleproduct. The fulfilment software needs to have one SKU/stock, since it’s the same product 3 times in the bundle. So I need to use autopricing with % discount.

    like this: https://ibb.co/PDz7bW7

    So no matter what I put there, 7.4 or 7.41 or 7.414159265 it will never get the total price as 275 It’s either 274.98 or 275.01 or anything else.

    In fact, it seems to only calculate percentage discount at 2 decimals. So if I put discount as 7.412523 it ignores the 2523 and only discounts 7.41 i think. And if I increase the decimal numbers in woo settings, then the price will be something like 274.9852359235 or 275.0159251529, never 275.

    So it seems like the bundle plugin always calculates the final bundle percentage discount price as 3 x 91.66 or whatever it is in 274.98. So I need to somehow round that number… if it’s possible.

    It seems the 91.66 number (the single product discounted price) is rounded at the number of decimals. Because 99 – 7.41% is 91.6641 and it’s calculating 3 * 91.66.

    If I put smaller discount, like 7.40 it results in 91.67 (again seems to be rounded at 2 decimals) which multiplied by 3 equals 275.01.

    So basically I want to round the final price, after it’s multiplied by the number of single products.

    If it’s possible.

    • This reply was modified 8 months ago by coadr93.
    Thread Starter coadr93

    (@coadr93)

    Hello, any solution? Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Rounding the discounted total price’ is closed to new replies.