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

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -