Jump to content

How to Edit "Create You Account" Form


Recommended Posts

Hi I am new Prestashop user of version 1.4.6.2 and I have a problem related to Create Your Account Form that I want to solve :

 

In the "Create Your Account" form there is an option of

 

"You must enter at least one phone number"

 

1. Home

2. Mobile

 

I would like to edit this text in the form to make entering Home phone number mandatory with a * mark and the form should check that it is filled before accepting new user registration.

 

This option is necessary for me to get payment gateway authentication (I am using EBS payment gateway) which uses the home phone number without which the transaction fails. Some customers do not enter home number , and there account creation is successful, but their transactions fail later when they place an order.

 

Is there a module available to edit information on Create Your Account form which I can install . If not what other ways are possible.

 

Any help or pointers will be really useful.

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I have similar problem to DragonWarrior.

 

I would like to exclude the phone requirement in "Create my Account" form.

 

I tried to remove the lines that refer to "phone" in Authentication.tpl and in tools/smarty/compile/*.file.authentication.tpl.php but then the "Create my Account" form is simply not shown when I click on user account link.

 

Help would be appreciated. Thank you.

Link to comment
Share on other sites

Hi I am new Prestashop user of version 1.4.6.2 and I have a problem related to Create Your Account Form that I want to solve :

 

In the "Create Your Account" form there is an option of

 

"You must enter at least one phone number"

 

1. Home

2. Mobile

 

I would like to edit this text in the form to make entering Home phone number mandatory with a * mark and the form should check that it is filled before accepting new user registration.

 

This option is necessary for me to get payment gateway authentication (I am using EBS payment gateway) which uses the home phone number without which the transaction fails. Some customers do not enter home number , and there account creation is successful, but their transactions fail later when they place an order.

 

Is there a module available to edit information on Create Your Account form which I can install . If not what other ways are possible.

 

Any help or pointers will be really useful.

You don't need a module to make this work. In fact the easiest way to do is from the back office of your PrestaShop. To make the home phone number required go to the Customers tab>Addresses sub-tab. At the bottom of the page click on the button Set required fields for this section; a table with field names will be displayed. Mark the checkbox for the field phone and click on the Save button. In this way the users will have to provide a home phone number in order to be able to register. They won't be able to registered by providing just a mobile phone number.

 

You can also change the text "You must register at least one phone number" that appears on the registration form to anything you want. This can also be done from the back office. Go to the Tools tab>Translations sub-tab. The first section on that page is Modify translations, from the drop-down menu in that section select Front Office translations, then click on the flag for the particular language. On the next page click on authentication, scroll down the page and find the above mentioned phrase that you need to change. Type the text that you want in the text field on the right and then click on the Update translations button.

 

That's it.

 

Cheers

  • Like 1
Link to comment
Share on other sites

Hi,

 

I have similar problem to DragonWarrior.

 

I would like to exclude the phone requirement in "Create my Account" form.

 

I tried to remove the lines that refer to "phone" in Authentication.tpl and in tools/smarty/compile/*.file.authentication.tpl.php but then the "Create my Account" form is simply not shown when I click on user account link.

 

Help would be appreciated. Thank you.

In your case you should be able to solve your problem by modifying the code in a couple of files.

 

The first one is AuthController.php, and if your PrestaShop is located in the root public_html directory on your account, it should be located in public_html/controllers/AuthController.php. Comment out the following code:

if (!Tools::getValue('phone') AND !Tools::getValue('phone_mobile'))
   $this->errors[] = Tools::displayError('You must register at least one phone number');

 

To comment it out just put /* at the beginning of the code and */ at the end.

 

The other file that you have to edit is the Authentication.tpl file for your theme. If you're using the default prestashop theme, the path to the file would be public_html/themes/prestashop/authentication.tpl. The code that you should comment out looks like this (it's near the end of the file):

<p style="margin-left:50px;">{l s='You must register at least one phone number'} <sup style="color:red;">*</sup></p>
 <p class="text">
  <label for="phone">{l s='Home phone'}</label>
  <input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" />
 </p>
 <p class="text">
  <label for="phone_mobile">{l s='Mobile phone'}</label>
  <input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" />
 </p>

To comment it out just put an exclamation mark and two hyphens after the first bracket (e.g.<!--p style) and two hyphens before the last bracket (e.g. p-->). Before you make such changes to the code of template files you should also enable the force compile option, so that you can see the change when you refresh your site's frontend. You can do this from the back office: Preferences tab>Performance sub-tab. After you're done disable the force compile.

 

Hope this helps. Have fun.

Link to comment
Share on other sites

In your case you should be able to solve your problem by modifying the code in a couple of files.

 

The first one is AuthController.php, and if your PrestaShop is located in the root public_html directory on your account, it should be located in public_html/controllers/AuthController.php. Comment out the following code:

if (!Tools::getValue('phone') AND !Tools::getValue('phone_mobile'))
$this->errors[] = Tools::displayError('You must register at least one phone number');

 

To comment it out just put /* at the beginning of the code and */ at the end.

 

The other file that you have to edit is the Authentication.tpl file for your theme. If you're using the default prestashop theme, the path to the file would be public_html/themes/prestashop/authentication.tpl. The code that you should comment out looks like this (it's near the end of the file):

<p style="margin-left:50px;">{l s='You must register at least one phone number'} <sup style="color:red;">*</sup></p>
 <p class="text">
  <label for="phone">{l s='Home phone'}</label>
  <input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" />
 </p>
 <p class="text">
  <label for="phone_mobile">{l s='Mobile phone'}</label>
  <input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" />
 </p>

To comment it out just put an exclamation mark and two hyphens after the first bracket (e.g.<!--p style) and two hyphens before the last bracket (e.g. p-->). Before you make such changes to the code of template files you should also enable the force compile option, so that you can see the change when you refresh your site's frontend. You can do this from the back office: Preferences tab>Performance sub-tab. After you're done disable the force compile.

 

Hope this helps. Have fun.

 

hxd,

 

that worked like a charm! :D

 

Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...