• Resolved goodmuyis

    (@goodmuyis)


    I need to display a notice for the User about their Membership plan and the expiration date in the child-theme header file. something like below

    Hello user your {xxx Membership plan} subscription expires in {xxx date}

    So what I need to pull out are Membership Plan and the Expired date
    I previously pull the data out from DB when we are using PMPro which was easy. But the serialized data stored in ms_subscriptions meta_key is difficult for me to deal with.

    I have search available info but can’t get my head round due to my limited coding skill

    The [ms-member-info] shortcode would have been ok if it includes Register date and Expired date value

    • This topic was modified 6 years, 3 months ago by goodmuyis.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter goodmuyis

    (@goodmuyis)

    Part of my findings in the link below would have solved my issue but $membership->period_date_end is empty when I run print_r($membership)

    if ( class_exists('MS_Model_Member') ) {
    	if ( MS_Model_Member::is_admin_user() ) {
    		_e( 'You are an admin user and have access to all memberships', MS_TEXT_DOMAIN );
    	}else{
    		$member = MS_Model_Member::get_current_member();
    
    		foreach ( $member->subscriptions as $subscription ) {
    			$membership = $subscription->get_membership();
    			echo $membership->name ." Expire in: ";
    			echo $membership->period_date_end;
    			echo "<hr>";
    			print_r($membership);
    		}
    	}
    }

    Code Source: https://premium.wpmudev.org/forums/topic/get-a-members-membership-level

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hey @goodmuyis,

    Hope you’re well.

    Sorry for the lateness of this topic. I am talking this with developers, I will inform you once I have more information. Thanks for your patience!

    Cheers,
    Oguz

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hey @goodmuyis,

    Hope you’re well.

    Can you try like $subscription->expire_date; instead of $membership->period_date_end; ?

    Cheers,
    Oguz

    Thread Starter goodmuyis

    (@goodmuyis)

    Thank You very much, $subscription->expire_date; work out as expected.
    I really do Appreciate the assistance

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How To Print Out Users Membership Micro-Details’ is closed to new replies.