WooCommerce – Validate Total Quantity of a Grouped Product

I have a grouped product set up in WooCommerce and I need some validation to make sure that the total quantity of all of the selected product options in the group is equal to a specific number when the user adds the product to the cart.

I’ve tried hooking into ‘woocommerce_add_to_cart_validation’ but that seems to run for each product option selected and not for all of them at the same time.

Read More

Ideally, I would also like to run this validation again for each grouped product in the cart when the user goes to checkout.

Is this possible and if so, does anyone have any idea how to do it?

Thanks.

Related posts

Leave a Reply