Jump to content

[Not New Topic] birthday field required


Recommended Posts

Hi all,

 

This is not a new topic it has been discussed earlier but that topic was tagged as solved hence i think all are ignoring, so started a new topic

 

My ps version is 1.5.6.0;

Except the customer registration module installed No other modules installed and i am using the default theme

My issue is i have This in Customer.php

 'birthday' => array('type' => self::TYPE_DATE, 'validate' => 'isBirthDate', 'required' => true),

I get an error even after someone enters the date of birth. Is there any more addition to be done. Or any other files have to be edited.

 

Regards

 

Amod

Link to comment
Share on other sites

Hi all,

 

I have Solved The problem for the above.

 

In the classes/validate.php you would see this somewhere aroung in the line 486

public static function isBirthDate($date)
    {
        if (empty($date) || $date == '0000-00-00')
            return true;

Change it to this

public static function isBirthDate($date)
    {
        if (empty($date) || $date == '0000-00-00')
            return false;

This atleast gives error as Invalid date of birth.

 

And if you have made changes in Customer.php as

'birthday' => array('type' => self::TYPE_DATE, 'validate' => 'isBirthDate', 'required' => true),

Remove 'required' => true

 

But now i need is the red mark on the registration page for birthdate (*) can anyone help in that.

 

Regards

 

Amod

  • Like 1
Link to comment
Share on other sites

  • 5 months later...
  • 1 year later...
×
×
  • Create New...