3

So I have read a few threads which all go into detail of removing the create account login button, hiding the content, and even creating a mini extension to remove such activity (http://importantmagento.blogspot.com/2012/06/how-to-disable-user-registration-in_22.html)

I have done all of these, however still adding customer/account/create/ to the end of the webstore still persists with a create account page. Any ideas what I can do here? I have a webstore in which we manually create each account, however it appears someone has found the loophole and persists in creating an account. Thanks!

3
  • 1
    Try disabling module output for Mage_Customer Commented Jan 15, 2016 at 18:40
  • Could also use an .htaccess URL rewrite to make it loop back to homepage.
    – dawhoo
    Commented Jan 15, 2016 at 19:16
  • That seems to remove all customer interaction, such as now there is no ability to log in
    – ne0nlight
    Commented Jan 15, 2016 at 19:16

2 Answers 2

6

You can simply use event controller_action_predispatch_customer_account_create to disable registration.

Register the event-observer

<events>
    <controller_action_predispatch_customer_account_create>
        <observers>
            <magepsycho_customer_controller_action_predispatch>
                <type>singleton</type>
                <class>magepsycho_customer/observer</class>
                <method>controllerActionPredispatchCustomerAccountCreate</method>
            </magepsycho_customer_controller_action_predispatch>
        </observers>
    </controller_action_predispatch_customer_account_create>
</events>

Implement the Observer Model

<?php

/**
 * @category   MagePsycho
 * @package    MagePsycho_Customer
 * @author     [email protected]
 * @website    http://www.magepsycho.com
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
class MagePsycho_Customer_Model_Observer
{
    public function controllerActionPredispatchCustomerAccountCreate(Varien_Event_Observer $observer)
    {   
        Mage::app()->getResponse()->setRedirect(Mage::getUrl('customer/account/login'))->sendResponse();
        exit();
    }
}

That's all. Don't forget to remove Register links from wherever it's visible :)

3
6

You can add custom URL Rewrite Rules in admin panel as well. check below example to redirect customer/account/create to customer/account/login

URL Rewrite Rules

1
  • 1
    Thank you, this is a lot easier indeed. I found URL Rewrite rules under the catologue menu and had to change the type to Custom before seeing your beautiful screenshot. You can put a dot (.) in the target Path to redirect to the home page. Then I removed all login forms in the template.
    – Pete
    Commented Sep 14, 2016 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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