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

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -