Regex For Quantity Picker
-
I’m attempting to overwrite the pattern matching for quantity picker. This is what I have thus far.
add_filter('woocommerce_quantity_input_pattern', 'eca_product_quantity_pattern'); function eca_product_quantity_pattern() { return '/^0$|^[1-9][0]*$/'; }I’m trying to restrict users to only be able to enter quantities with a 10 base eg 10, 20, 100, 500, 1000, 4000. Nothing that I override the pattern attribute in the input control seems to make a difference to the restriction.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Regex For Quantity Picker’ is closed to new replies.