Accessing amember product id's in Wordpress

Discussion in 'Payments processing' started by behaviourneeds, Nov 12, 2013.

  1. behaviourneeds

    behaviourneeds Member

    Joined:
    Jan 26, 2010
    Messages:
    47
    I am trying to display a custom menu in wordpress based on the product id in the users subscription. How can I access the amember sessions that contain this information?
    This is Amember v3.3 pro

    Thanks
    Chris
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You can access aMember's session variables from wordpress:
    PHP:
    <?php
    if($_SESSION['_amember_id']){
      
    // User is logged in; 
      
    if(in_array(1$_SESSION['_amember_product_ids'])){
        
    // user have subscription to product 1
      
    }

    }
    ?>
  3. behaviourneeds

    behaviourneeds Member

    Joined:
    Jan 26, 2010
    Messages:
    47
    Thanks Alexander.

    Worked a treat.

Share This Page