Adding a Custom Login Page After Payment

Discussion in 'Customization & add-ons' started by alexb, Jun 23, 2010.

  1. alexb

    alexb New Member

    Joined:
    Jun 23, 2010
    Messages:
    3
    Hi,

    We've got a link on our site that send the users directly to ClickBank payment page (users can click it without logging in). When CB sends the user back to our site, the ClickBank plugin tries to find the user by email, and creates a new user if the email doesn't exist in the DB.

    Most of the times this is OK, but sometimes existing users buy the product and they use a different email for payment. This causes the user to have two different accounts in AMember, as the CB plugin creates a new account for the second email.

    What we're trying to do is allow the users to login after the payment is done, but before the new user is created automatically by the ClickBank plugin.

    I've been looking at the code and I think this is possible - the first idea was to modify the ClickBank thanks.php page so it redirects to a custom login page and then proceed with the CB payment, but I've not managed to do it.

    Is this possible? And is this the right way to do it? If not, I would appreciate some instructions - just point me in the right direction :)

    Thanks very much :)


    Take care,
    Alex
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Alex, this will not help.
    aMember create user when receive IPN from clickbank and this does not matter
    will user be logged in or not at that point, the only solution that will help, is if user will renew from ammeber's renewal form.
    You can create cus;tom php file that will redirect user to renewal for for example renew.php:
    PHP:
    header("Location: /amember/member.php?action=renew&product_id=1&paysys_id=clickbank");
    exit;
    Then create custom login form and add this hidden input to it:
    Code:
    <input type='hidden' name='amember_redirect_url' value='renew.php'>
    
    So when user will login he will be redirected to renew.php and renew.php will redirect user to member's area where amember will create payment and redirect to clickbank automatically.
  3. alexb

    alexb New Member

    Joined:
    Jun 23, 2010
    Messages:
    3
    Hi alexander,

    Thanks for the reply :) Sounds like we might be able to use it - I'll look into it.

    Thanks again :)


    Take care,
    Alex

Share This Page