WC Lovers

WooCommerce Frontend Manager - Multivendor marketplace vendor dashboard

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Cancel payment of subscription but not subscription #101955
    defaperacm
    Participant

    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

Viewing 1 post (of 1 total)