Skip to content
Advertisement

Disable specific cart item quantity fields based on WooCommerce product category

In woocommerce I am using Hide “remove item” from cart for WooCommerce product category answer code and I would like to disable the cart quantity field too, avoiding customer to change the item quantity to zero.

Is that possible? Any track on this will be appreciated.

Advertisement

Answer

The following code will remove the “quantity field” from cart for items from a specific product category (that you will define in the 2nd function):

JavaScript

Code goes in function.php file of your active child theme (or active theme). Tested and works.

Note: If you are using also your other answer code, the first function is already defined and doesn”t have to be twice on your function php file…

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement