woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.3k stars 10.74k forks source link

Shipping prices incorrect #43445

Open daveloodts opened 8 months ago

daveloodts commented 8 months ago

Prerequisites

Describe the bug

In 8.4: set flat rate shipping price to €6,6033 (cause we need to show €7,99 as tax incl vat), just save it. Then reload the page, open up the shipping price and it displays €6,00.... So, re-saving this situation now results in a unintended shipping price. see screencast 8.4: https://share.woofers.be/2Nu9RGr4

In 8.5 it's a bit better, but it shortens the number of decimals from €6,6033 to €6,60, which is also not ideal.

Expected behavior

The number of decimals of shipping prices should not follow the general settings rule of "Number of decimals". If a merchant wants to enter €6,6033 to end up to a nice €7,99 incl tax shipping price, let them do this.

Actual behavior

In 8.4 there as a few issues - i guess- and 8.5 just shortens it.

Steps to reproduce

  1. set flat rate price to €6,6033
  2. save it
  3. check flat rate price in 8.4: €6,00
  4. check flat rate price in 8.5: €6,60

WordPress Environment

impacts every store

Isolating the problem

zelimir83 commented 8 months ago

Same issue here, setting the flate rate shipping price to 4.7 results in saving the shipping price to 4. Woocommerce version 8.4.0 , all other plugins dectivated, fresh install without any mods.

jonathansadowski commented 8 months ago

Thanks for the reports @daveloodts and @zelimir83.

The issue in 8.4 was known (a duplicate of #42759) and resolved by #42795, which was included in WooCommerce 8.5.

I'll keep this issue open to track the rounding issue which you described that still exists in 8.5.

passatgt commented 6 months ago

I think a similar issue happens in this situation:

  1. Setup a tax rate of 27%
  2. Create a shipping rate that costs 1968.5, so the gross total would be 2500
  3. Create the order, everything seems right
  4. Click recalculate in the order, now the cost jumps to 2501

Before recalculate:

image

After recalculate:

image

This was tested with Woo 8.4 and 8.5.2, both produces the same issue.