• I’m working with max/min quantity values. I’ll refer mainly to the max values for now to save topic clutter.

    I’m using this filter ‘woocommerce_quantity_input_max’ to control the maximum allowed quantity per order. It’s being applied in the following templates single-product\add-to-cart\simple.php, single-product\add-to-cart\grouped.php, single-product\add-to-cart\variation-add-to-cart-button.php. So no issue altering the max quantity on the single product pages.

    The filter is running on values being passed to the function ‘woocommerce_quantity_input’ which is defined in wc-template-functions.php

    The problem I’m having is the filter isn’t being applied to the max_value values passed to ‘woocommerce_quantity_input’ in the cart\cart.php template.

    As a temp fix I’ve overwritten the cart\cart.php template and applied the filter myself.

    As a permanent plugin solution would there be an issue with removing the quantity filters from all the templates files and instead applying them directly to values in the woocommerce_quantity_input function itself? The default value in the function already uses the filter. It would also allow for better/cleaner “Apply sanity to min/max args” functionality inside woocommerce_quantity_input().

    Any advice/thoughts would be appreciated.

    Thanks. Lee.

The topic ‘woocommerce_quantity_input filters’ is closed to new replies.