quantity-input.php template is out of date
-
Couple of issues that are all kind of related…
Your override of
quantity-input.php
is not up to date. Core template supports a placeholder attribute, seen here:
https://github.com/woocommerce/woocommerce/blob/master/templates/global/quantity-input.php#L44(It might also be helpful to have a
@version
tag in the doc header for easy comparison.Placeholders feature I use in my Mix and Match Products plugin…. to leave the inputs empty by default. But two things happen to a user who is using my plugin in conjunction with yours:
The inputs don’t get the placeholder I’ve assigned them:
https://share.getcloudapp.com/p9uPZEZzAnd in your script, an empty input is failing the
isNaN()
condition and returning early before it can trigger the.change()
even that my plugin is listening for.You could patch this by changing
var val = parseFloat(qty.val());
to
var val = "" !== qty.val() ? parseFloat(qty.val()) : 0;
I hope you will take this into consideration.
Cheers,
-Kathy
- The topic ‘quantity-input.php template is out of date’ is closed to new replies.