Jump to content
SirNewbie

remove required fields from customer signup

Recommended Posts

Hey, there are two fields i would like to remove from the customer signup page:

 

 

"Assign an address alias for future reference"

"Date of Birth"

 

Has anyone removed fields before? How can this be done?

 

Thanks!

Share this post


Link to post
Share on other sites

Hi :)

 

First, the fields you wanna hide are not actually required. If you need to remove required fields you need to edit the /classes/Customer.php too( line - protected $fieldsRequired = ...). But in your case this is not necessary.

 

You dont want to remove the "Assign an address alias for future reference" because it is essential for prestashop, every address must have a name, so you can have multiple addreses.

But since its auto-filled, I guess it will still work if its hidden by css, with display:none.

 

To hide it, add this code in autentification.css(or global.css)

#address_alias {
display: none;
}

Havent tried it, but I guess you'll still be able to registed + assign a name to the adress. Let me know if there is a problem.

 

 

To remove the date of birth, you need to comment or delete this from the authentification.tpl and identity.tpl (and order-opc-new-account.tpl if you use one page checkout)

 <p class="select">
  <span>{l s='Date of Birth'}</span>
  <select id="days" name="days">
   <option value="">-</option>
   {foreach from=$days item=day}
	<option value="{$day|escape:'htmlall':'UTF-8'}" {if ($sl_day == $day)} selected="selected"{/if}>{$day|escape:'htmlall':'UTF-8'}  </option>
   {/foreach}
  </select>
  {*
   {l s='January'}
   {l s='February'}
   {l s='March'}
   {l s='April'}
   {l s='May'}
   {l s='June'}
   {l s='July'}
   {l s='August'}
   {l s='September'}
   {l s='October'}
   {l s='November'}
   {l s='December'}
  *}
  <select id="months" name="months">
   <option value="">-</option>
   {foreach from=$months key=k item=month}
	<option value="{$k|escape:'htmlall':'UTF-8'}" {if ($sl_month == $k)} selected="selected"{/if}>{l s="$month"} </option>
   {/foreach}
  </select>
  <select id="years" name="years">
   <option value="">-</option>
   {foreach from=$years item=year}
	<option value="{$year|escape:'htmlall':'UTF-8'}" {if ($sl_year == $year)} selected="selected"{/if}>{$year|escape:'htmlall':'UTF-8'}  </option>
   {/foreach}
  </select>
 </p>

 

Hope that helps you enough :)

 

Dont forget to add [sOLVED] and if my comment was helpfull to you, feel free to like it :P

 

Merry Christmas

  • Like 3

Share this post


Link to post
Share on other sites

In trying to follow the instructions to hide the address alias, I can't find that class in either global.css nor authentication.css (I'm assuming you meant authentication rather than "authentification" as I don't see that file anywhere.

 

Has "Sir Newbie" or anyone else yet successfully done this yet?

Share this post


Link to post
Share on other sites

That's because you have to add the above mentioned code in the authentication.css file.

 

#address_alias {
	display: none;
}

 

You can find the file in the css folder of your theme. For example, if you use the default prestashop theme and your store is installed directly in the public_html directory, you can find it in public_html/themes/prestashop/css/authentication.css.

 

After you add the code and you save the file, clear your browser's cache, refresh the frontend of your store and test the registration page. The alias field should be gone. Keep in mind that it's still required, it's only hidden from the registration page. The field will be filled with the default My address value.

 

I hope this helps.

  • Like 1

Share this post


Link to post
Share on other sites

That's because you have to add the above mentioned code in the authentication.css file.

 

#address_alias {
	display: none;
}

 

You can find the file in the css folder of your theme. For example, if you use the default prestashop theme and your store is installed directly in the public_html directory, you can find it in public_html/themes/prestashop/css/authentication.css.

 

After you add the code and you save the file, clear your browser's cache, refresh the frontend of your store and test the registration page. The alias field should be gone. Keep in mind that it's still required, it's only hidden from the registration page. The field will be filled with the default My address value.

 

I hope this helps.

 

Oh! I thought I was just adding the "display: none" attribute.

I'll add it all. Thanks

Share this post


Link to post
Share on other sites

It's been a while but I finally got around to trying to remove the date of birth.

I deleted those sections from the 3 files specified and it's still showing up.

Even after force compile.

 

Any ideas?

 

The address alias is gone though.

Share this post


Link to post
Share on other sites

The above mentioned code for the date of birth in the authentication.tpl file is there twice. One is closer to the beginning of the file, and the other is towards the end. Delete or comment out the code that's closer to the end of the file.

Share this post


Link to post
Share on other sites

Hi :)

 

First, the fields you wanna hide are not actually required. If you need to remove required fields you need to edit the /classes/Customer.php too( line - protected $fieldsRequired = ...). But in your case this is not necessary.

 

You dont want to remove the "Assign an address alias for future reference" because it is essential for prestashop, every address must have a name, so you can have multiple addreses.

But since its auto-filled, I guess it will still work if its hidden by css, with display:none.

 

To hide it, add this code in autentification.css(or global.css)

#address_alias {
display: none;
}

Havent tried it, but I guess you'll still be able to registed + assign a name to the adress. Let me know if there is a problem.

 

 

To remove the date of birth, you need to comment or delete this from the authentification.tpl and identity.tpl (and order-opc-new-account.tpl if you use one page checkout)

 <p class="select">
  <span>{l s='Date of Birth'}</span>
  <select id="days" name="days">
   <option value="">-</option>
   {foreach from=$days item=day}
	<option value="{$day|escape:'htmlall':'UTF-8'}" {if ($sl_day == $day)} selected="selected"{/if}>{$day|escape:'htmlall':'UTF-8'}  </option>
   {/foreach}
  </select>
  {*
   {l s='January'}
   {l s='February'}
   {l s='March'}
   {l s='April'}
   {l s='May'}
   {l s='June'}
   {l s='July'}
   {l s='August'}
   {l s='September'}
   {l s='October'}
   {l s='November'}
   {l s='December'}
  *}
  <select id="months" name="months">
   <option value="">-</option>
   {foreach from=$months key=k item=month}
	<option value="{$k|escape:'htmlall':'UTF-8'}" {if ($sl_month == $k)} selected="selected"{/if}>{l s="$month"} </option>
   {/foreach}
  </select>
  <select id="years" name="years">
   <option value="">-</option>
   {foreach from=$years item=year}
	<option value="{$year|escape:'htmlall':'UTF-8'}" {if ($sl_year == $year)} selected="selected"{/if}>{$year|escape:'htmlall':'UTF-8'}  </option>
   {/foreach}
  </select>
 </p>

 

Hope that helps you enough :)

 

Dont forget to add [sOLVED] and if my comment was helpfull to you, feel free to like it :P

 

Merry Christmas

Hi! Snade,

I want to hide a Post Code as required field. I think I must fill the field with dummy data and use your code :

 

 

#address_alias {

display: none;

}

to hide this field in css.file. But I don't know how to fill dummy data in phpMyAdmin like this screenshoot :

Ubah+Post+Code+di+MyAdmin.jpg

Share this post


Link to post
Share on other sites

SNADE (Alexander) has it right. Just remember though that if the changes DON'T show, you probably need to log into your back office and go to Preferences.

Then go to Performance (in the sub-menu below the tabs).

 

Under the heading Smarty choose the following options:

Force compile: Yes

Cache: No

 

And remember to REVERSE this when your store goes live!

Share this post


Link to post
Share on other sites
The above mentioned code for the date of birth in the authentication.tpl file is there twice. One is closer to the beginning of the file, and the other is towards the end. Delete or comment out the code that's closer to the end of the file.

Thanks Hxd!

At first, I am in fault deleting Date of the Birth field. But now I was succesfully do it at my PS www.lovingprize.com due to care with your advice.

Edited by yusufzulkarnain (see edit history)

Share this post


Link to post
Share on other sites

I am using PS 1.5.4. I have tried to add

#address_alias {

display: none;

}

 

in either to global.css or authentication.css

Clean cache (everthing). restart server....

But it doesn't work. Keep showing the alias box

The auto-flled seem doesn't work well

 

I have spending 2 hours to try to get throung. It is really make me crazy. Please help

Share this post


Link to post
Share on other sites

I am using PS 1.5.4. I have tried to add

#address_alias {

display: none;

}

 

in either to global.css or authentication.css

Clean cache (everthing). restart server....

But it doesn't work. Keep showing the alias box

The auto-flled seem doesn't work well

 

I have spending 2 hours to try to get throung. It is really make me crazy. Please help

 

I went to themes/default/address.tpl and deleted:

 

<p class="required text" id="adress_alias">

<label for="alias">{l s='Please assign an address title for future reference.'} <sup>*</sup></label>

<input type="text" id="alias" name="alias" value="{if isset($smarty.post.alias)}{$smarty.post.alias}{else if isset($address->alias)}{$address->alias}{else if !isset($select_address)}{l s='My address'}{/if}" />

</p>

 

but this stopped me from checking out so I had to add the code back again.

Edited by PartsTrader (see edit history)

Share this post


Link to post
Share on other sites

Hi friends,

I want to remove all fields from the authentication form in one page checkout when user come without login.

I only need there email , password and phone number .

is it possible ?

Pls help me....

Edited by addonvivek (see edit history)

Share this post


Link to post
Share on other sites

Hi there,

 

Please try this to change address format:

Go to Back Office:

 

Shipping / Countries / choose your country / Address format

Then you can change

Hope helpful.

If you can't do, just contact to my email or skype: nguyennham.1012@gmail.com, nguyennham.1012

Share this post


Link to post
Share on other sites

that's correct!

your method nguyennham.1012 works like a charm

Share this post


Link to post
Share on other sites

Do you think that for the "Assign an address alias for future reference" it's possible to hide it, and automatically assign to that field customer name+surname? In this way every title has a different name. Having same title for 2 or more adress could create any problem?

  • Like 2

Share this post


Link to post
Share on other sites

Please try this to change address format:

Go to Back Office:

 

Shipping / Countries / choose your country / Address format

Then you can change 

 

Can somebody confirm that this method still works for Prestahop 1.6? I was not succeed with applying abovementioned - my quickorder page still shows whole set of default address fields, even after clearing cache

Share this post


Link to post
Share on other sites

Hi,

I am trying to remove "mobile phone" from prestashop 1.6.

Can somebody help?

Share this post


Link to post
Share on other sites

Localisation, > Countries >  .... EDIT 

for address formats, compulsory fields etc.  should help most of the questions in this old thread for current 1.6 versions.

 

There's too many things broken in Prestashop...

"There is 1 error

  1. alia is required. "

What a great intuitive error message, telling the customer they should have given an "address title"

Calling it an address reference such as work, home etc would be a start.  But as for the error, cant even find where it's generated and mispelled.

Share this post


Link to post
Share on other sites

   Please help me to hide the "alias" field from my prestashop >> 1.7.2.4

and want to hide it from checkout page and order details.

thank you all;

  • Like 1

Share this post


Link to post
Share on other sites
On 12/16/2017 at 6:38 PM, charafi said:

   Please help me to hide the "alias" field from my prestashop >> 1.7.2.4

and want to hide it from checkout page and order details.

thank you all;

Hi charafi, did you solve this ?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More