How to check if user is pending or active [php]

Discussion in 'Customization & add-ons' started by fluxxagency, May 9, 2014.

  1. fluxxagency

    fluxxagency New Member

    Joined:
    Apr 15, 2014
    Messages:
    3
    How can we check if a user is pending or active? We want to remind pending users to enter their credit card details so if they are pending we would like to show a message throughout our site.

    We offer a 15 day trial so some people are signing up and ditching the page once they are asked for credit card details thinking they don't need a credit card for the free trial.

    If they do ditch the page, we want a notice to show throughout the site telling them to activate their subscription(enter credit card details).

    Example:

    if (active){
    show this
    } else{
    do nothing
    }
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
  3. essam_saad

    essam_saad aMemberer

    Joined:
    Apr 14, 2014
    Messages:
    6
    This is very useful! Thank you @caesar

    I know Am_Lite API perefct If I want to include it in my external application but:

    Is there a better way to display that within amember pages especially "Main page"?

    Cheers,
  4. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Do you want to do it in aMember template?
    You can use this code in this case:
    Code:
    <?php if (in_array(1, $di->user->getActiveProductIds)) : ?>
    <p>some html content</p>
    <?php endif; ?>
    essam_saad likes this.
  5. essam_saad

    essam_saad aMemberer

    Joined:
    Apr 14, 2014
    Messages:
    6
    Great! Thank you.
  6. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    You are welcome!

Share This Page