HowTo:Add the registration form to the login page
From ZenMagick Wiki
The first step is to include the registration form in login.php. The easiest way is the one-liner:
<?php include('create_account.php') ?>
at the bottom of login.php.
If you now try the login page you’ll see that it actually breaks. The reason for this is that create_account.php expects the objects $zm_account and $zm_address in the request.
So, the second step is to create a custom login controller that initializes empty instances of ZMAccount and ZMAddress, respectively. The new class file LoginController.php should be placed in the theme’s extra folder.
A very minimal version (no comments, bad indentation) would look similar to this:
class LoginController extends ZMLoginController {
function __construct() {
parent::__construct();
}
function processGet() {
$account = ZMLoader::make(”Account”);
$account->populate();
$address = ZMLoader::make(”Address”);
$address->populate();
$this->exportGlobal(”zm_account”, $account);
$this->exportGlobal(”zm_address”, $address);
return parent::processGet();
}
}
So, what we are doing here is overriding the the controller’s processGet() method in order to add the missing objects to the templates environment. That way the template can use them to populate the form (with the initially empty values).
Everything else works as before. If the server side validation fails, the form returned is actually the original create_account.php form. This is in line with the current behavior of zen-cart.

