Make Date of Birth Optional for Create Account

Making the create account process as streamlined as possible will encourage your customers to create accounts on your zen cart site and increase your conversion rate. This tutorial will show you how to make the date of birth an optional field in your zen cart store create account form. By default, the date of birth field is required to create an account.

This tutorial features the Alysa Rounded free zen cart template by Picaflor Azul. If you want to use it for your zen cart project you can download it for free here.

1. Log into your zen cart admin and go to Configuration -> Customer Details

Click on “Date of Birth”, select “true”, and click on the update button.

Go to Admin -> Configuration -> Miminum Values

Click on “Date of Birth” set the number to “0” and click on the “Update” button.

In your favorite plain text editor, open includes/languages/your-custom-template/english.php file. If there isn’t already an override for that file, copy the includes/languages/english.php file to includes/languages/your-custom-template/english.php. On or around line 193 find this code:

define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 05/21/1970)');

And change it to this (you are taking out the asterisk – *):

define('ENTRY_DATE_OF_BIRTH_TEXT', ' (eg. 05/21/1970)');

Save the file.

***This is a php file and MUST be edited in a plain text editor. If you try to edit this file in any type of wysiwyg editor, the code will be corrupted and when you insert the file back into your zen cart it will break your entire site.***

In your favorite plain text editor, open includes/templates/your-custom-template/templates/tpl_modules_create_account.php file. If there isn’t already an override for that file, copy the includes/templates/template_default/templates/tpl_modules_create_account.php file to includes/templates/your-custom-template/templates/tpl_modules_create_account.php. On or around line 140 find this code:


< ?php echo zen_draw_input_field('dob','', 'id="dob"') . (zen_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '' . ENTRY_DATE_OF_BIRTH_TEXT . '': ''); ?>

And change it to this:


< ?php echo zen_draw_input_field('dob','', 'id="dob"') . (zen_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? ENTRY_DATE_OF_BIRTH_TEXT : ''); ?>

Save the file.

***This is a php file and MUST be edited in a plain text editor. If you try to edit this file in any type of wysiwyg editor, the code will be corrupted and when you insert the file back into your zen cart it will break your entire site.***

Navigate to your create account page and hit the “refresh” button to see the date of birth field changed from required to optional.

If you need help customizing your zen cart web site, or would like a great custom design, please contact us for a quote.

equation