Alex Rivera | Logout

How to disable frontend registration in Magento

Asked 2010-06-02T15:27:20.303
13

As titled.

But still, users can login to the frontend, and administrator could create user account only in backend.

Edit
Report

2 Answers

12

Another possibility would be overloading the customer/account/create action and just redirect the user to the home page when this action is invoked.

In a first time, just do what was proposed by Ben V. It will remove the possibility to view the registration page.

Then, create a new module in which you will overload the AccountController.php.

1- Create a new folder in app/code/local/ named Mycompany

2- Create a new folder in app/code/local/Mycompany/ named Registrationremove

3- Create app/code/local/Mycompany/Registrationremove/etc/

4- Create app/code/local/Mycompany/Registrationremove/etc/config.xml

Copy and Paste in config.xml :

<?xml version="1.0"?>
<config>
    <modules>
        <Mycompany_Registrationremove>
            <version>0.1.0</version>
        </Mycompany_Registrationremove>
    </modules>
    <global>
        <rewrite>
             <mycompany_registrationremove_customer_account_create>
                      <from><![CDATA[#^/customer/account/create/$#]]></from>
                      <to>/registrationremove/customer_account/create</to>
                 </mycompany_registrationremove_customer_account_create>
                 <mycompany_registrationremove_customer_account_createPost>
                     <from><![CDATA[#^/customer/account/createPost/$#]]></from>
                     <to>/registrationremove/customer_account/createPost</to>
                 </mycompany_registrationremove_customer_account_createPost>
           </rewrite> 
    </global>

    <frontend>
        <routers>
            <registrationremove>
                <use>standard</use>
                <args>
                    <module>Mycompany_Registrationremove</m
answered 2010-06-02T20:38:28.460
2

In the above example structure, the controller class name should be changed from

class Mycompany_Registrationremove_AccountController extends Mage_Customer_AccountController

to

class Mycompany_Registrationremove_Customer_AccountController extends Mage_Customer_AccountController

answered 2010-10-22T09:28:13.347

Your Answer