Jump to content

[SOLVED] required fields in authentication.tpl


Recommended Posts

hello

 

I have been making some modifications to this file.

 

I have successfully removed the "receive offers from our partners bit" (after i realise that there are 2 bits to comment out!!)

 

i am trying to make date of birth a required field as we are selling age sensitive products.

I have a changed the class to "required select" but I figure there must be more to it than this as it doesn't make it a required section!

 

I have also commented out the "address alias" bit but the website is still asking for it.

 

any help asap please?!

 

thanks in anticipation

Link to comment
Share on other sites

Hi,

you cannot just comment the address alias, since its essential for prestashop, in order to support multiple adresses. 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;
}

 

The required fields are stated required in /classes/Customer.php in line

protected	 $fieldsRequired = array('lastname', 'passwd', 'firstname', 'email');

make it

protected	 $fieldsRequired = array('lastname', 'passwd', 'firstname', 'email', 'birthday');

 

Let me know if this solves it for you.

 

If it does, dont forget to add [solved] in the topic name, and also I'll be happy if you "like" my post, if it was helpfull to you. Thanks !

  • Like 3
Link to comment
Share on other sites

hellllllllppp please!

 

i forgot to actually test this all the way through and it's not letting users register.

there seems to be 2 "birthday" fields in Prestashop. there is "birthday" but the one actually used consistes of 3 fields "days"< "months" and "years". i protected these fields, but then the system comes up with a fatal error when trying to post the information to day "days" is empty (i suspest it would for all but days is first in the line).

 

i tried protecting "birthday" but this isn't actually a field so it doesn't work,

 

any other suggestions?

Link to comment
Share on other sites

Hi, before I posted the solution in first place, I tested it. Now I tested it again, just in case, and again it works for me. See the attached img, this is the error when no birthday is entered(ignore the mobile error)

Also, it gives error when the birth is not entered correctly(see img 2).

 

Then when I enter birthday, everything is just fine.

 

The first time I tested it on 1.4.5.1 version, now I tested it on 1.4.6.2. What version do you use, and do you use opc, maybe that can cause problems.

 

 

here is the code from the working example (with few lines before and after the edited line)

....
public  $months;
protected $tables = array ('customer');
 protected  $fieldsRequired = array('lastname', 'passwd', 'firstname', 'email', 'birthday');
 protected  $fieldsSize = array('lastname' => 32, 'passwd' => 32, 'firstname' => 32, 'email' => 128, 'note' => 65000);
....

post-58696-0-16753400-1326760088_thumb.png

post-58696-0-72203600-1326760950_thumb.png

Link to comment
Share on other sites

  • 11 months later...
Hi, before I posted the solution in first place, I tested it. Now I tested it again, just in case, and again it works for me. See the attached img, this is the error when no birthday is entered(ignore the mobile error) Also, it gives error when the birth is not entered correctly(see img 2). Then when I enter birthday, everything is just fine. The first time I tested it on 1.4.5.1 version, now I tested it on 1.4.6.2. What version do you use, and do you use opc, maybe that can cause problems. here is the code from the working example (with few lines before and after the edited line)
 .... public $months; protected $tables = array ('customer'); protected $fieldsRequired = array('lastname', 'passwd', 'firstname', 'email', 'birthday'); protected $fieldsSize = array('lastname' => 32, 'passwd' => 32, 'firstname' => 32, 'email' => 128, 'note' => 65000); .... 

 

 

Hi I have the same problem of having the 2 error messages after upgrading to 1.5.2,

 

Also, i cannot find the above codes in /classes/Customer.php.

 

Anyone can assist? Must appreciated! :)

Link to comment
Share on other sites

  • 3 weeks later...
×
×
  • Create New...