Skip to content

This basic Magento1 module exposes a new admin option and related methods to disable users registration on the frontend.

License

Notifications You must be signed in to change notification settings

borasocom-team/Magento-PreventUsersRegistration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magento-PreventUsersRegistration

This basic Magento1 module exposes a new admin option and a couple of related methods to disable users (customers) registration on the frontend.

  1. The module defaults to "allow registrations" (no changes from Magento default behaviour)
  2. Activate it at default/website/store level via Admin -> System -> Configuration -> Prevent users registration
  3. As soon as the module is active, /customer/account/create/ redirects to /customer/account/login/
  4. You must manually edit your templates to hide all the links to the registration page: see a worked-for-me list at the bottom

Template example

<?php
if( Mage::helper('boraso_preventusersregistration')->allowUsersRegistration() ) { ?>

	<a href="/customer/account/create/">REGISTER NOW!</a>

<?php
}//end Registrazione abilitata
?>

Template file list

These files have at least one link to the registration page. It must be wrapped as shown above.

  1. /app/design/frontend/custom_package_name/default/template/page/html/header.phtml
  2. /app/design/frontend/custom_package_name/default/template/persistent/checkout/onepage/login.phtml
  3. /app/design/frontend/custom_package_name/default/template/persistent/customer/form/login.phtml
  4. /app/design/frontend/custom_package_name/default/template/customer/form/login.phtml (unused?)

Install script

If you want to automatically disable disable users (customers) registration at install-time, package this code as an install/upgrade script:

<?php
/**
 * Disabilito registrazione utenti su website EN
 * ---------------------------------------------
 *
 * Questo valore viene letto da Boraso_PreventUsersRegistration
 */

$installer = $this;

$installer->startSetup();

Mage::getConfig()->saveConfig('preventusersregistration/settings/allowusersregistration', '0', 'websites', 2);

$installer->endSetup();

Replace websites with the desired scope and 2 with the ID.

About

This basic Magento1 module exposes a new admin option and related methods to disable users registration on the frontend.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages