Get is_purchasable hook working for Woocommerce product variations too
I have made 2 custom product fields - availability - since when/until when. So if the current date is between these set availability dates then product is purchasable, else - it's not. Everything works perfectly however only until I post a product with a variations. Then it's like product variations ignore these custom availability fields/values and still let to add variations to cart even if current date is not between set availability dates. function hide_product_if_unavailable( $is_purchasable, $object ) { $date_from = get_post_meta( $object->get_id(), '_availability_schedule_dates_from' );