Set a subscription as purchasable / not purchasable

add_filter('woocommerce_subscription_is_purchasable','change_subscription_purchasable', 10, 2);

function change_subscription_purchasable($purchasable, $product){

	if( $product->product_type == 'subscription'){
		// your code....
	}

	if( $product->product_type == 'variable-subscription'){
		// your code...		
	}

	return $purchasable;
}

Leave a Comment