[Plugin: Woocommerce Subscriptions] How to get subscription key or id
-
I need to get the subscription key of a particular subscription to pass into a custom function. I have referenced the documentation where it shows how to get the key, but I have failed to integrate this into my code. So what my code does is, when a renewal is triggered, I hook into processed_subscription_payment with my function. So this code is run only when a subscription renewal is payed. Code is below.
Documentation is here: https://docs.woothemes.com/document/subscriptions/develop/functions/management-functions/
Code here (which resides in functions.php):
add_action( 'processed_subscription_payment', 'callupdater' ); function callupdater() { //need to get the subscription key here to pass to updatedays() $key = ..... updatedays(key); } function updatedays($subscription_key) { //do some tasks with the key }
Any help is very much appreciated. I am very new to PHP so excuse my ignorance.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: Woocommerce Subscriptions] How to get subscription key or id’ is closed to new replies.