Archived topic
Input Comma in quantity field
18 replies · Started by Jochen on March 4, 2021
Hej,
I am selling mostly products based on weight. Hence, the customers will be able to order decimal quantities.
However, I just realised that I am not able to enter a Comma in the single-products quantity input, e.g. https://www.kraemerladen.bio/produkt/bio-datteln-medjool/
I figured out that this is due to the events fired by your theme on keyup, given in plugins/gp-premium/woocommerce/functions/js/woocommerce.min.js?ver=1.12.3 on line 1025.
Any quick fix for that?
Thanks,
jochen
Hi there,
That's strange, I'm not seeing anything in our javascript that would prevent this. The file you mentioned in the minified version - can you spot the issue in the non-minified version?
Is the issue only when manually inputting a number with a comma vs. a decimal?
Hej,
Thanks!
How can I force generatePress to use the non-minified version?
It is only when manually inputting a number via keyboard. I just figured out, that it works if you enter a decimal value reeeeally fast.
This is how to test the non-minified version: https://wordpress.org/support/article/debugging-in-wordpress/#script_debug
Does the same issue happen if you turn off the quantity buttons in Customize > Layout > WooCommerce?
Thanks,
I realised some things:
- the issue does not occur in Edge
- the issues does not occur in Chrome
> It is just Firefox, even in Safe Mode.
- using quantity buttons from the plugin "Woocommerce Min Max Step Control" is not generating this issue
- using the non-minified js does not change anything
- any different character than a number brings up the issue (",", ".","-" ..)
Any idea?
Thanks
Did you see if it was still an issue with the quantity buttons turned off?
It is not an issue with the buttons turned off.
Thanks for confirming. I'll test this some more and will get back to you :)
I'm not able to get the standard quantity input to accept , at all, even if I change the decimal separator in the WooCommerce settings, or set my WordPress language to a language that uses commas.
Can you link me to a page where it's possible maybe?
I disabled the themes quantity buttons. Now it is possible, but I would like to keep the buttons.
I'm not able to use a comma in there. What language is your keyboard set to?
Well,that is getting more and more weird ;)
I am using a German keyboard setting. However, if I set it to English it works as well.
As soon as I enable the themes' quantity button it is not possible in Firefox anymore.
Are you using a plugin or a specific setting to allow decimal steps in the quantity field?
as mentioned above I am using the plugin “Woocommerce Min Max Step Control”
Can you try replacing your woocommerce.min.js file with this?: https://pastebin.com/raw/Ldg6SJ1x
Any change?