Jump to content

remove required fields from customer signup


Recommended Posts

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
Link to comment
Share on other sites

  • 3 months later...

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?

Link to comment
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
Link to comment
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

Link to comment
Share on other sites

  • 4 weeks later...

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.

Link to comment
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.

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

  • 3 months later...

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!

Link to comment
Share on other sites

  • 1 month later...
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)
Link to comment
Share on other sites

  • 3 months later...

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

Link to comment
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)
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
  • 2 months later...

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
Link to comment
Share on other sites

  • 1 year later...

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

Link to comment
Share on other sites

  • 4 months later...
  • 10 months later...

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.

Link to comment
Share on other sites

  • 1 year later...
  • 2 years later...

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...