Join our new community forum for support & discussion

Join Now

Home Support Extensions Memberships check which plan a user is on?

check which plan a user is on?

  • Author
    Posts
  • thekeeks

    Hi,

    Is there a way to check which membership level a user has, using the hivepress() object?

    yevhen developer

    Yes, it is possible to get the current user Membership object this way:
    hivepress()->request->get_context('membership')

    thekeeks

    hi,

    I can’t seem to find the users current membership plan.

    I thought i would be able to find the “Free Plan” in the object, but i’m unable.

    Any help?

    yevhen developer

    Please make sure that you are logged in and the current user has some membership, the code above should return the Membership model object, if you get it then you can use it this way:
    $membership->get_name();
    $membership->get_listing_attributes();

    thekeeks

    Thanks,

    I tried, but it didnt work.

    $membership = hivepress()->request->get_context(‘membership’);
    $membership->get_name();
    $membership->get_listing_attributes();

    yevhen developer

    Please copy this code again.

    $membership = hivepress()->request->get_context('membership');

    If the current user has some membership the code above should return the Membership model object. If you have some errors please share them here

Viewing 6 posts - 1 through 6 (of 6 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.