So what I gather form your question you want to run 2 shops in the same Magento installation both with different registration forms?
You're using the store code added to the base url approach so just to make sure you have all the basic steps covered to run both stores please check out this page. In short the steps are
- create a directory for the url addon (in your case website1 and website2)
- copy the index.php and .htaccess to this directory
- Change in the index the
$mageRunCode to the shops code and
$mageRunType to website
- then create symbolic links for
Now for the registration form. You'll have to first set up 2 template directories for the 2 shops. In case the design should look the same I suggest the following setup. Let's say your theme's name is
- default (this contains all the template files both shops need)
Now in the BE under
Design set up
shoppersdesign as the
Current package name, depending on the shop shop1 or shop2 for all the fields under
Default which should be default.
This way you can edit only the registration form PHTML without having to copy all the template files.
For the AccountController this is a little bit more tricky since only one codebase can be used per Magento installation. I guess you need to add some extra fields to save in the database?
One option would be to copy it to the directory of that store creating the path
./websites1/app/code/core/Mage/Customer/controllers/AccountController.php but that would require you to make symlinkes for ALL the other files and directories that are in any of the subdirectories you've created.
In this case, since you're already editing the forms I would create a
createPostAction method and call it
createPost2Action. Do this by overwriting/extending the controller in your own extension and adding the method to your controller class. This post by Inchoo will explain more about that.
Now you can edit the registration form to post to
Now personally I would want to go about extending a controller for this since it's kind of messy. Better to use an observer in my opinion. I did some Googling and seems you're best of using the
controller_action_postdispatch_customer_account_createpost event to observe. When this event is triggered the customer is already saved in the database. You could load it by email and perform what ever extra actions you need to do.
your extensions config.xml
public function addExtraData(Varien_Event_Observer $observer)
$post = Mage::app()->getRequest()->getPost();
$customer = Mage::getModel('customer/customer')->loadByEmail($post['email']);
I hope all of the above is a bit helpful to you as I wasn't 100% sure what you were trying to accomplish.