Display a Signup form after clicking Submit on another Signup form

Discussion in 'Customization & add-ons' started by websiteworldbiz, Dec 17, 2015.

Thread Status:
Not open for further replies.
  1. websiteworldbiz

    websiteworldbiz New Member

    Joined:
    Aug 7, 2013
    Messages:
    10
    We have two signup forms
    1) Landing Page - by removing the Product and Payment System Bricks
    2) Video Sales signup form - by adding a video and showing two product choices

    After filling out Name and Email and clicking NEXT on the (1)Landing Page we want to show the (2)Video Sales page instead of the member area page. We only want this change to be specific to (1)Landing Page Form and not for all other forms. It would be great if we can do it in such a way that the customization would survive any future aMember upgrades.

    How do we change this in aMember 4.x?

    Would love to pay someone to do this if it is too hard.
    We prefer someone in the USA due to time zone constraints.

    Thanks in Advance
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Unfortunately there is not such option in admin interface but it is easy to do as customization (upgrade proof).
    You need to edit site.php (http://www.amember.com/docs/Site.php_file) file and put the following code:
    PHP:
    Am_Di::getInstance()->hook->add(Am_Event::SIGNUP_USER_ADDED, function(Am_Event $e) {
       
    $sv $e->getSavedForm();
       if (
    $sv->code == 'CODE OF YOU FORM') {
           
    $u $e->getUser();
           
    $u->data()->set('next_redirect''http://localhost/test')
               ->
    update();
       }
    });

    if ((
    $u Am_Di::getInstance()->auth->getUser()) &&
        (
    $nr $u->data()->get('next_redirect'))) {
         
    $u->data()->set('next_redirect'null)
             ->
    update();
         
    Am_Controller::redirectLocation($nr);
    }
    In code above replace CODE OF YOU FORM and http://localhost/test with desired values.
  3. websiteworldbiz

    websiteworldbiz New Member

    Joined:
    Aug 7, 2013
    Messages:
    10
    Thanks that works!
    The CODE OF YOUR FORM caused me to stumble at first. But then I realized it was just the 'Secret Code' of your form you created in aMember

    So for example if your Secret Code you assigned to your form is 'landing', then you can see your form at http://www.mywebsite.com/amember/signup/landing

    And you would use if ($sv->code == 'landing') {

    Thanks again Caesar
  4. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    You are welcome!
Thread Status:
Not open for further replies.

Share This Page