Forum Replies Created
Viewing 1 post (of 1 total)
- AuthorPosts
- January 14, 2020 at 1:56 am in reply to: Cancel payment of subscription but not subscription #101955defaperacmParticipant
first issue solved with this code (just add tho functions.php in custom theme):
$cancelled = false; function on_cancelled_subscription($user_id) { if (!$cancelled) { update_user_meta( $user_id, '_disable_vendor', false ); $user = get_user_by( 'id', $user_id ); $user->set_role( 'wcfm_vendor' ); } $cancelled = true; } add_action('wcfm_membership_data_reset', 'on_cancelled_subscription');
$cancelled flag is used because the action ‘on_cancelled_subscription’ may be called more tha one time, so it prevents from spamming the database
this code was made by ¿reverse-engineered? the file class-wcfmvm.php
- AuthorPosts
Viewing 1 post (of 1 total)