Expired Subscriptions

Discussion in 'Customization & add-ons' started by softstor, Jul 4, 2009.

  1. softstor

    softstor New Member

    Joined:
    Mar 1, 2006
    Messages:
    27
    I am using the session variables to read the payments received. But it only generates it for active subscriptions. Is it possible to use the session variables to pull up payments for expired subscriptions too?
  2. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Should be if you add condition to your existing code to list along the lines of testing if membership has expired. $mem_status = '2' for expired active is '1'. '0' is pending

    PHP:
    $mem_status = ($_SESSION['_amember_user'][status]);
    Above gives overall status of member but there is also available in aMember another array '$member['data']['status']' where data is product id and status is status for that particular product.
  3. softstor

    softstor New Member

    Joined:
    Mar 1, 2006
    Messages:
    27
    Thanks for the reply but I am actually interested in retrieving payments for all purchases. I wish to generate a payment history for a customer account without having to use using mysql code.

    Right now I am using the following code example for pulling up payments:

    Code:
    $subscriptions = $_SESSION['_amember_subscriptions'];
    $payment = $subscriptions[$i][amount]
    
    In the loop for $i, I can retreive all payments a customer has made. However, this will only work for active subscriptions and is not displaying payments for old expired subscriptions.

    I would like it to generate payments for all subscriptions (expired and not expired).
  4. jenolan

    jenolan aMember Coder

    Joined:
    Nov 3, 2006
    Messages:
    510
    You would need to run a query and retrieve them.
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Yes you need to query for all payments:
    Code:
    include "/full/path/to/amember/config.inc.php";
    $payments = $db->get_user_payments($_SESSION[_amember_id], 1); // Will return all completed payments(active/expired)
    
  6. softstor

    softstor New Member

    Joined:
    Mar 1, 2006
    Messages:
    27
    Thanks. The code seems to work very well.

Share This Page