Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    153
    Plugin Contributions
    0

    Default [Done v1.3.9] Problem with customer's date of birth in admin

    I noticed that if, in Configuration / Minimum Values the Date of Birth parameter is set to 0, then there is an issue when you try to change the date of birth of a customer in the admin part : after you submit your changes, no error message will be displayed by the date will be set to 0001-01-01...

    Example (verified on my 1.3.8a cart and on a fresh install) :

    Set Configuration / Minimum Values, Date of Birth = 0
    Go to admin/customers.php
    Select any profile, click on Edit
    Change the Date of Birth to anything you want, or even don't change it at all
    Submit the changes
    Click again on Edit -> the date of birth has disappeared.

    I think the problem comes from admin/customers.php file, where:

    Code:
            if (ACCOUNT_DOB == 'true') {
              if (ENTRY_DOB_MIN_LENGTH >0) {
                if (checkdate(substr(zen_date_raw($customers_dob), 4, 2), substr(zen_date_raw($customers_dob), 6, 2), substr(zen_date_raw($customers_dob), 0, 4))) {
                  $entry_date_of_birth_error = false;
                } else {
                  $error = true;
                  $entry_date_of_birth_error = true;
                }
              } else {
                $customers_dob = '0001-01-01 00:00:00';
              }
            }
    If ENTRY_DOB_MIN_LENGTH = 0, the date of birth is automatically set to 0001-01-01 00:00:00


    sanji

  2. #2
    Join Date
    Jan 2004
    Posts
    65,195
    Blog Entries
    7
    Plugin Contributions
    76

    Default Re: Problem with customer's date of birth in admin

    Quote Originally Posted by sanji View Post
    Code:
            if (ACCOUNT_DOB == 'true') {
              if (ENTRY_DOB_MIN_LENGTH >0) {
                if (checkdate(substr(zen_date_raw($customers_dob), 4, 2), substr(zen_date_raw($customers_dob), 6, 2), substr(zen_date_raw($customers_dob), 0, 4))) {
                  $entry_date_of_birth_error = false;
                } else {
                  $error = true;
                  $entry_date_of_birth_error = true;
                }
              } else {
                $customers_dob = '0001-01-01 00:00:00';
              }
            }
    
    Yes -- rearrange the highlighted lines, as shown:
    Code:
            if (ACCOUNT_DOB == 'true') {
              if (ENTRY_DOB_MIN_LENGTH >0) {
                if (checkdate(substr(zen_date_raw($customers_dob), 4, 2), substr(zen_date_raw($customers_dob), 6, 2), substr(zen_date_raw($customers_dob), 0, 4))) {
                  $entry_date_of_birth_error = false;
                } else {
                  $error = true;
                  $entry_date_of_birth_error = true;
                }
              }
            } else {
              $customers_dob = '0001-01-01 00:00:00';
            }
    And, then if you want the DOB to be optional, set the Minimum Value for DOB to blank instead of 0 (otherwise the admin will pop up an alert saying it's not filled in).
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2005
    Posts
    153
    Plugin Contributions
    0

    Default Re: Problem with customer's date of birth in admin

    Thanks DrByte ;)

    sanji

 

 

Similar Threads

  1. v154 Date of Birth still in Customer Account Creation
    By edbeck in forum Customization from the Admin
    Replies: 15
    Last Post: 13 Jun 2015, 01:53 PM
  2. Customer Birth Date
    By hdolinski in forum Managing Customers and Orders
    Replies: 2
    Last Post: 14 Oct 2014, 09:48 PM
  3. Issue w/ Customer Account Create DOB / Date of Birth Pulldown Mod
    By Donn in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 18 Feb 2009, 10:33 PM
  4. Registration & Birth date - problem with the format
    By sanji in forum General Questions
    Replies: 1
    Last Post: 7 Nov 2007, 05:16 AM
  5. date of birth in admin customer.php
    By grantc in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 11 Aug 2006, 05:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR