Redirect after signup

Discussion in 'Customization & add-ons' started by leora, Nov 23, 2011.

  1. leora

    leora New Member

    Joined:
    Nov 13, 2011
    Messages:
    4
    Is there a way that I can have the user redirected to a different page and not member.php after signup?

    Thanks,
    Leora
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Hi Leora, what aMember Pro version are you using?
  3. leora

    leora New Member

    Joined:
    Nov 13, 2011
    Messages:
    4
    the latest version.
    Thanks,
    Leora
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Latest version of 3.2x or 4.x?

    David
  5. leora

    leora New Member

    Joined:
    Nov 13, 2011
    Messages:
    4
    3.2.4
    Thanks,
    Leora
  6. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Edit the product URL in the specific product. If a single product is ordered, they will be redirected to that.
    If the user has more than 1 active product, then they will be sent to member.php. You can make a hack to the thanks.html page to redirect to another page in that case.

    David
  7. clickthrough

    clickthrough New Member

    Joined:
    May 16, 2012
    Messages:
    4
    Hi all

    I have the exact same question but am on version 4.1.15. Any ideas?

    Currently we offer just one (free) product so after signup I'd like the user to be taken straight to it.
  8. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    in 4.x go to amember admin / setup / login page
    Redirect after login, either fixed url, or first link
    Automatically login customer after signup, checked

    If you set to first link- you need to create a link in 'protect content'

    David
  9. clickthrough

    clickthrough New Member

    Joined:
    May 16, 2012
    Messages:
    4
    Hi David

    Thanks for the reply, but that does not work. I always end up on the thanks page after signup.

    I've tried removing newsletter checkbox from the form as well but that made no difference.

    Any more ideas?

    Thanks, Neil
  10. clickthrough

    clickthrough New Member

    Joined:
    May 16, 2012
    Messages:
    4
    Having looked into the code, Am_Paysystem_PayProcessMediator->process() always runs and does the redirect (there is the chance for a callback before the redirect, but this is not set.) As I mentioned, I only have one product and it is free.

    Thanks, Neil
  11. maximize

    maximize Member

    Joined:
    Mar 5, 2007
    Messages:
    108
    Neil,

    Try this in your application/configs/site.php

    // this adds a field to the product edit page
    Am_Di::getInstance()->productTable->customFields()->add(
    new Am_CustomFieldText(
    'thankyou_redirect',
    'Custom thank you page URL',
    'A URL to a custom thank page where customers will be redirected to after purchasing this product. Leave empty for standard amember behavior.'
    )
    );


    // Custom thank you redirection by product
    function redirectThankyou(Am_Event $event)
    {
    // get list of product objects
    $product_list = $event->getInvoice()->getProducts();

    foreach ($product_list as $product)
    {
    // find a product, may only be one, that has redirect configured
    if (trim($product->data()->get('thankyou_redirect')))
    {
    header('location: '.$product->data()->get('thankyou_redirect'));
    exit();
    }
    }
    }

    Am_Di::getInstance()->hook->add(Am_Event::THANKS_PAGE, 'redirectThankyou');
    kriss likes this.
  12. kriss

    kriss Member

    Joined:
    Feb 5, 2013
    Messages:
    48
    Thanks Maximize!! That works perfectly!

Share This Page