WooCommerce Shipping Cost Validation Limits Decimal Places to 2
Summary:
A validation issue in WooCommerce prevents entering shipping costs with more than 2 decimal places in the shipping method configuration. When a user attempts to save a shipping cost value like 3.0678 (4 decimal places), the system throws a "Please enter a valid number" error and rejects the input.
The problem appears to be caused by overly strict client-side or server-side validation that enforces a 2-decimal-place limit, which conflicts with the needs of stores requiring more precise shipping calculations. This is particularly impactful for stores that need to calculate exact shipping rates based on complex formulas or currency conversions that result in values requiring 3 or 4 decimal places of precision.
The reporter specifically mentions referencing issue #60348, indicating this may be related to recent validation changes that unintentionally restricted decimal place allowances in shipping cost fields.
How to Replicate:
- Navigate to WooCommerce Settings
- Go to Shipping section
- Select any shipping method
- In the Cost field, enter a value with more than 2 decimal places (e.g., 3.0678)
- Attempt to save the shipping method
- Observe the "Please enter a valid number" error message