Table of Contents
Problem Description #
The plugin requires comma separators for quantities (or shows wrong decimals) and users in locales using comma as decimal separator see incorrect values.
Common symptoms:
- The plugin returns an error or refuses a quantity when users type 1,5 (comma) vs 1.5 (dot).
- Price calculations show incorrect decimal places.
Cause:
Different locales expect different decimal/thousands separators. The plugin may validate input using a specific format or not convert localized input to the expected canonical number format.
Solution – step-by-step #
- Check WordPress / WooCommerce locale settings
- Ensure Settings → General → Site Language and WooCommerce > Settings > General currency/location are correct for your locale. Some plugins respect WP locale.
- Test canonical format
- Try entering quantities with dot (1.5) and comma (1,5) to confirm which works. Use the plugin’s docs for guidance. WPFactory
- If plugin validates input, modify input before calculation (developer)
Add a small JS normalization function to replace commas with dots before sending values for calculation:
jQuery( document ).on(‘input’, ‘.quantity’, function(){
var v = jQuery(this).val();
jQuery(this).val( v.replace(‘,’, ‘.’) );
});
- Important: Test carefully, this may alter UX expectations.
- Report to plugin author for locale support
- Ask the plugin to support locale-aware parsing or provide a setting to accept comma or dot. Provide examples and locale settings.
- Ask the plugin to support locale-aware parsing or provide a setting to accept comma or dot. Provide examples and locale settings.
Prerequisites #
- Ability to add small JS snippet to your theme or via custom JS.
- Staging recommended if editing code.
Additional notes / prevention tips #
Document expected input format for users on product pages if immediate change is not possible.