WCFM Membership subscription timelines

WooCommerce Multivendor Marketplace – Home Forums WCfM – Feature Request WCFM Membership subscription timelines

This topic contains 7 replies, has 2 voices, and was last updated by WCfM Forum WCfM Forum 2 months, 1 week ago.

  • Author
    Posts
  • #32213

    kasaga311
    Participant

    Hi,

    It would be nice if the Membership plugin shows the following details on the WCFM Dashboard when the user login is done next to the Vendor details on the ‘Welcome to Dashboard’ panel:

    1. Membership since: Date on which the user subscribed to a plan
    2. Membership expires in: <num days>

    Thanks,
    –Kasaga

  • #32441
    WCfM Forum
    WCfM Forum
    Keymaster

    Hi,

    Sure, we will add this in coming version.

    Thank You

  • #32945

    kasaga311
    Participant

    Hi,

    Any update on this please?

    Thanks

  • #33132
    WCfM Forum
    WCfM Forum
    Keymaster

    Hi,

    Kindly add this code for the purpose –

    function wcfmvm_0310_vendor_dashboard_username( $vendor_id ) {
    	$wcfm_membership_id = get_user_meta( $vendor_id, 'wcfm_membership', true );
    	if( $wcfm_membership_id && wcfm_is_valid_membership( $wcfm_membership_id ) ) {
    		$next_schedule = get_user_meta( $vendor_id, 'wcfm_membership_next_schedule', true );
    		$current_time = strtotime( 'midnight', current_time( 'timestamp' ) );
    		
    		if( $next_schedule ) {
    			$date = date( 'Y-m-d', $current_time );
    			$renewal_date = date( 'Y-m-d', $next_schedule );
    			$datetime1 = new DateTime( $date );
    			$datetime2 = new DateTime( $renewal_date );
    			$interval = $datetime1->diff( $datetime2 );
    			$interval = $interval->format( '%r%a' );
    			
    			echo '<span class="wcfm_welcomebox_member">( ' . __( 'Expire In', 'wc-multivendor-membership' ) . ': <mark>' . $interval . '</mark> days)</span>';
    		}
    	}
    }
    add_action( 'wcfm_dashboard_after_username', 'wcfmvm_0310_vendor_dashboard_username', 50 );

    Thank You

  • #33134

    kasaga311
    Participant

    Hi,

    Added this to our code.

    However, we are looking for Member since and not the Expires in.

    Can you suggest the solution for the same?

    Thanks,
    –Kasaga

  • #33135
    WCfM Forum
    WCfM Forum
    Keymaster

    Hi,

    1. Membership since: Date on which the user subscribed to a plan
    2. Membership expires in:

    You were looking for this, right?

    Anyway no problem, remove that code and use this one –

    function wcfmvm_0410_vendor_dashboard_username( $vendor_id ) {
    	$udata = get_userdata( $vendor_id );
      $registered = $udata->user_registered;
      echo '<div class="wcfm_welcomebox_last_time"><span class="fa fa-user"></span><span class="wcfm_welcomebox_member">' . __( 'Registered On', 'wc-multivendor-membership' ) . ': <mark>' . date_i18n( wc_date_format(), strtotime( $registered) ). '</mark></span></div>';
    }
    add_action( 'wcfm_dashboard_after_username', 'wcfmvm_0410_vendor_dashboard_username', 50 );

    Thank You

  • #33154

    kasaga311
    Participant

    Hi,

    Awesome! Works like a charm..

    Thanks,
    –Kasaga

  • #33155
    WCfM Forum
    WCfM Forum
    Keymaster

    Great … you are welcome 🙂

The topic ‘WCFM Membership subscription timelines’ is closed to new replies.