How to Disable Product Quantity(Plus-Minus) Buttons?

In Astra Pro Addon’s version 2.1.0, we have improved the Product Quantity input’s old number field and replaced it with the Plus-Minus buttons.

For which we have provided a Filter that will disable the Product Quantity’s Plus-Minus buttons. This will be for the Product Quantity field on the WooCommerce Cart and Single Product Page.

This change could now be seen for the Product Quantity Input field on WooCommerce Cart and Single Product Page.

Product Quantity old buttons before Astra 2.1.0

Some users, still require to have the below number field for the product quantity. Here’s a screenshot of the old quantity field –

To achieve this requirement, we are providing a filter in our Astra Pro Addon’s plugin version 2.1.3. Make sure you update the plugin to version 2.1.3 or above to use the filter.

add_filter( 'astra_add_to_cart_quantity_btn_enabled', '__return_false' ); 

Description: This filter is built to replace the product quantity’s new plus-minus field to the old number field.

You will need to add this filter, in the child theme’s last line of functions.php.

Note: Since this functionality is JavaScript based so in some cases this functionality might not work with the third-party plugins and in such cases, users can also use the above filter.

Not the solution you are looking for? Check other articles, or open a support ticket.