Suraj Posted November 29, 2009 Share Posted November 29, 2009 I want to disable the registration temporary ? How to do ? Thanks Link to comment Share on other sites More sharing options...
tomerg3 Posted November 29, 2009 Share Posted November 29, 2009 Change you /themes/prestashop/authentication.tpl line 36-48 from {l s='Create your account'} {l s='Enter your e-mail address to create your account'}. {l s='E-mail address'} <input type="text" id="email_create" name="email_create" value="{if isset($smarty.post.email_create)}{$smarty.post.email_create|escape:'htmlall'|stripslashes}{/if}" class="account_input" /></span> {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if} <input type="submit" id="SubmitCreate" name="SubmitCreate" class="button_large" value="{l s='Create your account'}" /> <input type="hidden" class="hidden" name="SubmitCreate" value="{l s='Create your account'}" /> To something like {l s='Create your account'} {l s='Registration is currently not available'}. <!-- {l s='Enter your e-mail address to create your account'}. {l s='E-mail address'} <input type="text" id="email_create" name="email_create" value="{if isset($smarty.post.email_create)}{$smarty.post.email_create|escape:'htmlall'|stripslashes}{/if}" class="account_input" /></span> {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if} <input type="submit" id="SubmitCreate" name="SubmitCreate" class="button_large" value="{l s='Create your account'}" /> <input type="hidden" class="hidden" name="SubmitCreate" value="{l s='Create your account'}" /> --> Link to comment Share on other sites More sharing options...
Suraj Posted November 29, 2009 Author Share Posted November 29, 2009 thanks, i m going to try it and let you know. Link to comment Share on other sites More sharing options...
mm242 Posted June 15, 2010 Share Posted June 15, 2010 Hi,the reply below (changes to the PHP code) sounds interesting but... will it still be possible to buy online?cheers,-mm Link to comment Share on other sites More sharing options...
tomerg3 Posted June 15, 2010 Share Posted June 15, 2010 only registered users will be able to buy something.I actually have a module on my store (Private Shop) which lets you disable registration, or just require the approval of any new account (from the module's configuration page). 1 Link to comment Share on other sites More sharing options...
Prestachopo Posted March 25, 2011 Share Posted March 25, 2011 Instead use HTML comments, use Smarty comments like:{* my html code that hidden from source in Web page! this text not show in source when you press CTRL+U *} If not do this any user can view source with Firebug and enable HTML code remove only <!-- ---> marks and register in your website Link to comment Share on other sites More sharing options...
telesuite Posted January 20, 2012 Share Posted January 20, 2012 Have a look in solution http://www.prestashop.com/forums/topic/139489-disable-registration/ seems more sophisticated if you can add a script to edit the variable "regenabled" from true to false with your checks. Thanks Link to comment Share on other sites More sharing options...
mrcypress Posted March 27, 2012 Share Posted March 27, 2012 HERE IS THE SOLUTION !!!! First of all modify this file: prestashop_root_folder/controllers/AuthController.php Simply you have to comment these lines (usually from 46 to 63): if (Tools::isSubmit('SubmitCreate')) { if (!Validate::isEmail($email = Tools::getValue('email_create')) OR empty($email)) $this->errors[] = Tools::displayError('Invalid e-mail address'); elseif (Customer::customerExists($email)) { $this->errors[] = Tools::displayError('An account is already registered with this e-mail, please fill in the password or request a new one.'); $_POST['email'] = $_POST['email_create']; unset($_POST['email_create']); } else { $create_account = 1; self::$smarty->assign('email_create', Tools::safeOutput($email)); $_POST['email'] = $email; } } Now the "Create your account" button is disabled!! Now you have to hide the register new account form. Edit the file: /prestashop_root_folder/themes/your_theme/css/authentication.css add "color: transparent;" and "margin-left: 9000%" option to the "#create-account" lines. Probably you will need to split some line from others grouped by a comma (","): it's simple, you have just to remove the comma and insert a "{" and a "}" after the option. See below this example (authentication.css file used in the black-white free template downloaded from http://addons.presta...lack-white.html). ORIGINAL FILE: /* authentication.tpl */ #create-account_form, #authentication #login_form { width: 49%; height: 20em; clear: none; float: left } #create-account_form h4 { height: 3.4em; padding: 0.3em 3em 0 4em } #create-account_form p.text, #authentication #login_form p.text { height: 3.4em; margin-left: 4em; padding-left: 0; padding-right: 0 } #authentication #login_form a { color: #000 } #create-account_form { margin-right: 11px } #create-account_form p.text { text-align: left; width: 100px } #authentication #create-account_form p.text label { width: 100px } #authentication input#SubmitCreate, #authentication input#SubmitLogin { margin: 0 } #authentication p.submit { margin-right: 0; text-align: left; padding-left: 17%!important } #authentication p.lost_password { padding-left: 4em } #authentication #create-account_form fieldset, #authentication #login_form fieldset { height: 18em } #authentication p.submit span { padding-right: 0.5em } #create-account_form label, #authentication #login_form label { float: none; clear: both; display: block; text-align: left; width: 100%; margin-bottom: 0.3em } #account-creation_form input.text, #account-creation_form #id_country, #account-creation_form #id_state, #authentication textarea { width: 17em } .account_creation span.inline-infos { width:100%; text-align:left; margin:2px 0 2px 32%; font-size:9px; } MODIFIED FILE: /* authentication.tpl */ #create-account_form { color: transparent; } #authentication #login_form { margin-top: -160px; width: 49%; height: 20em; clear: none; float: right } #create-account_form h4 { color: transparent; height: 3.4em; padding: 0.3em 3em 0 4em } #create-account_form p.text { color: transparent; } #authentication #login_form p.text { height: 3.4em; margin-left: 4em; padding-left: 0; padding-right: 0 } #authentication #login_form a { color: #000 } #create-account_form { color: transparent; margin-right: 11px } #create-account_form p.text { color: transparent; text-align: left; width: 100px } #authentication #create-account_form p.text label { margin-left: 9000%; width: 100px } #authentication input#SubmitCreate { margin-left: 9000%; } #authentication input#SubmitLogin { margin: 0 } #authentication p.submit { margin-right: 0; text-align: left; padding-left: 17%!important } #authentication p.lost_password { padding-left: 4em } #authentication #create-account_form fieldset { margin-left: 9000%; } #authentication #login_form fieldset { height: 18em } #authentication p.submit span { padding-right: 0.5em } #create-account_form label { color: transparent; } #authentication #login_form label { float: none; clear: both; display: block; text-align: left; width: 100%; margin-bottom: 0.3em } #account-creation_form input.text { color: transparent; } #account-creation_form #id_country { color: transparent; } #account-creation_form #id_state { color: transparent; } #authentication textarea { width: 17em } .account_creation span.inline-infos { color: transparent; width:100%; text-align:left; margin:2px 0 2px 32%; font-size:9px; } Link to comment Share on other sites More sharing options...
Recommended Posts