WCFM Membership subscription timelines

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!

Viewing 7 reply threads
  • 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
      Member

      Hi,

      Sure, we will add this in coming version.

      Thank You

    • #32945
      kasaga311
      Participant

      Hi,

      Any update on this please?

      Thanks

    • #33132
      WCFM Forum
      Member

      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
      Member

      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
      Member

      Great … you are welcome 🙂

Viewing 7 reply threads
  • The topic ‘WCFM Membership subscription timelines’ is closed to new replies.