We run a self-storage system with WooCommerce and we use WooCommerce Subscriptions plugin. Our storage units is a unique product with a Variable Subscription. Each variation has a different billing period (1 month, 3 months, 6 months and 12 months). I need the whole parent product, or at least all variations, to be out of stock if one variation is out of stock.
I didn't find any related setting and I didn't find how to make that possible yet.
Any help is appreciated.
The following will make all variations out of stock (for specific variable product(s)), when one variation is out of stock (also works with WooCommerce subscriptions):
Code goes in function.php file of your active child theme (active theme). Tested and works.