Hello,
I am trying to disable frontend customer registration for a specific website / store view within Magento 1.9.2.2.
I was given the following solution
<events> <customer_registration_is_allowed> <observers> <your_module_set_is_active> <class>Your_Module_Model_Observers_Customer</class> <method>disableCustomerRegistration</method> </your_module_set_is_active> </observers> </customer_registration_is_allowed> </events>
class Your_Module_Model_Observers_Customer { /** * Force disable customer registration * * @param Varien_Event_Observer $observer Observer * @return void */ public function disableCustomerRegistration($observer) { $result = $observer->getResult(); if ($result->getIsAllowed() === true) { $result->setIsAllowed(false); } } }
In if condition, you can use current store and website Id for disable customer regsitration process for particular store and website.
The issue is, I do not know where I should insert this code.
I have tried to find the file at this path: frontend/rwd/kellyseye/template/persistent/customer/form/login.phtml
But I can't find this in my folder structure via FTP.
Please help!
Hello @jordan_cardwell
You can do like this :
=> Add app/etc/modules/Mycompany_All.xml
<?xml version="1.0"?> <config> <modules> <Mycompany_Registrationremove> <active>true</active> <codePool>local</codePool> </Mycompany_Registrationremove> </modules> </config>
=> Modify the file : app/code/local/Mycompany/Registrationremove/etc/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> <mycompany_registrationremove> <use>standard</use> <args> <module>Mycompany_Registrationremove</module> <frontName>registrationremove</frontName> </args> </mycompany_registrationremove> </routers> </frontend> </config>
Reference link : https://stackoverflow.com/a/2989739/4093735
It may be helpful for you.
If issue solved , Click Kudos & Accept as Solution
Hello @jordan_cardwell,
Why didn't you try code? It's working well.
https://stackoverflow.com/a/2989739/2595841
If you have any trouble then let us know.
Hello jordan_cardwell
Kindly find below code for Disable Frontend Registration.
class Your_Module_Model_Observers_Customer { /** * Force disable customer registration * * @param Varien_Event_Observer $observer Observer * @return void */ public function disableCustomerRegistration($observer) { $result = $observer->getResult(); if(Mage::app()->getStore()->getWebsiteId() == 1) { $result->setIsAllowed(false); }else{ $result->setIsAllowed(true); } } } }
If you've found my answer useful, please give "Kudos" or "Accept as Solution"