php - WooCommerce Subscriptions + WP Funds -


i need add funds user's account via account funds on successful renewal of membership via woocommerce subscriptions.

is there way via wp functions? ifso how this? have tried following no luck.

add_action('processed_subscription_payment', 'custom_add_funds', 10, 2);  function custom_add_funds($user_id) {      // current user's funds     $funds = get_user_meta( $user_id, 'account_funds', true );      // add £40     $funds = $funds + 40;      // add funds user     update_user_meta( $user_id, 'account_funds', $funds );  } 

account funds: https://docs.woocommerce.com/document/account-funds/

subscriptions: https://docs.woocommerce.com/document/subscriptions/


Comments

Popular posts from this blog

c++ - CPP, 'X' button listener -

shared memory - gstreamer shmsrc and shmsink with h264 data -

.net - Bulk insert via Dapper is slower than inserting rows one-by-one -