0

The problem was that the following:

<?php echo $this->getBlockHtml('formkey') ?>

Had to be added to:

   template/customer/form/register.phtml

I am using the following inside a PTHML file:

if(!Mage::getSingleton('customer/session')->isLoggedIn()){
  echo "<h1>YOU ARE NOT LOGGED IN</h1>";
  echo $this->getLayout()->createBlock('customer/form_register')->setTemplate('customer/form/register.phtml')->toHtml();
  echo "<br><br>";
  echo $this->getLayout()->createBlock('customer/form_login')->setTemplate('customer/form/mini.login.phtml')->toHtml();
}

This creates the forms, as expected, however when I fill out the registration form and click the submit button I am directed to:

domain.com/customer/account/create/

When I fill out the login form I am redirected to:

domain.com/customer/account/login/referer/aHR0cDovL2Rldi53d3cucHJvdGVjdHlvdXJib3VuZGFyaWVzLmNhL2N1c3RvbWVyL2FjY291bnQvaW5kZXgv/

The user is not successfully logged in at this point.

I don't see any errors in the log files. Am I missing something? I wonder could it be related to the formkey stuff that was added?

My ultimate goal is:

  1. User comes to Page X while not logged in.
  2. User registers and/or logs in. (this is where I am stuck)
  3. User is returned to the Page X. (I have an observer that should work once above is solved)
  • 1
    Just a minute to late ;) - if adding the form key fixed your problem please post it as an answer. – Christoph Farnleitner Mar 7 '18 at 19:58
1

The problem was that the following:

<?php echo $this->getBlockHtml('formkey') ?>

Had to be added to:

   template/customer/form/register.phtml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.