• 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.

    https://ww.wp.xz.cn/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    Have you checked the source to see if your number input has the above? Remember this is not supported in all browsers.

Viewing 1 replies (of 1 total)

The topic ‘Regex For Quantity Picker’ is closed to new replies.