I am using a plugin "WooCommerce Subscriptions" and I want to check if the product already has the active subscriber in the system
I only want 1 subscriber per product. There is a filter available to check it but I don't know how to use it:
https://docs.woocommerce.com/document/subscriptions/develop/filter-reference/
How can I use that functions or hooks, to achieve this?
Thanks
This custom made conditional function will return
true
if a subscription product is already actively used by a subscriber.This code goes on function.php of your active child theme (or theme) or also on any plugin file.
I just have used here
wcs_get_users_subscriptions()
native subscription function, to get the subscriptions for a defined user ID, in my code.All code is tested and fully functional
References: