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 -

Get Max value from table in hibernate -

r - geom_bar tied exactly to x and y axis (without aggregating) -