Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Feature Request › WCFM Membership subscription timelines
- This topic has 7 replies, 2 voices, and was last updated 6 years, 2 months ago by WCFM Forum.
- AuthorPosts
- September 22, 2018 at 10:29 am #32213kasaga311Participant
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 - September 24, 2018 at 7:48 pm #32441WCFM ForumMember
Hi,
Sure, we will add this in coming version.
Thank You
- October 1, 2018 at 5:43 am #32945kasaga311Participant
Hi,
Any update on this please?
Thanks
- October 3, 2018 at 4:52 am #33132WCFM ForumMember
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
- October 3, 2018 at 5:58 am #33134kasaga311Participant
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 - October 3, 2018 at 6:47 am #33135WCFM ForumMember
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
- October 3, 2018 at 10:19 am #33154kasaga311Participant
Hi,
Awesome! Works like a charm..
Thanks,
–Kasaga - October 3, 2018 at 10:30 am #33155WCFM ForumMember
Great … you are welcome 🙂
- AuthorPosts
- The topic ‘WCFM Membership subscription timelines’ is closed to new replies.