lachaca Posted September 8, 2009 Share Posted September 8, 2009 can i make the birthday field as a required field?i try any possibilities but no kein success.we need this for the security and checks.who can help, please!thanks Link to comment Share on other sites More sharing options...
CyberLolita Posted January 22, 2010 Share Posted January 22, 2010 I need to know how to do this too. I want to restrict under 18s from buying the lingerie & adult toys but can't figure out how to do this... Please help us someone!! Link to comment Share on other sites More sharing options...
Perkla Posted February 1, 2010 Share Posted February 1, 2010 Have a look at this link, its the same thing but its birthday u are about to require.. http://www.freeprestashopmodules.com/2009/11/06/how-to-make-phone-field-required-at-registration/I think that should be usefull help for u... Link to comment Share on other sites More sharing options...
sgtbash Posted February 28, 2010 Share Posted February 28, 2010 Hmm, I'm trying to do this also.I cant figure out how to get prestashop to take the 3 different variables of the DOB and make them required.the name of the input fields for the DOB are 'days' 'months' and 'years'... ive tried putting those into the 'required' script as mentioned on that website (and in this post: http://www.prestashop.com/forums/viewthread/33592/) with no luck...PS will show an error if you do not complete the respected field (days for days, months for months etc) but once youve completed all three it will show a hack attempt error and says the variable is empty.I've tried using 'birthday' which is what the mysql databases uses for storing it and the form will then show an error as you have not filled in the 'birthday' field (which obviously doesnt exist on the form as it uses 3 drop downs.Any help would be greatly appreciatedThanksDan Link to comment Share on other sites More sharing options...
sgtbash Posted March 17, 2010 Share Posted March 17, 2010 Bump - Does anyone have any idea on how to do this? Link to comment Share on other sites More sharing options...
ibs_ia Posted September 7, 2010 Share Posted September 7, 2010 I also want to do that...any ideas????thanks! Link to comment Share on other sites More sharing options...
Jeet Kune Do Posted January 5, 2011 Share Posted January 5, 2011 It will be great if somebody point us in the right direction.Regards! Link to comment Share on other sites More sharing options...
Jeet Kune Do Posted February 17, 2011 Share Posted February 17, 2011 Someone?? Link to comment Share on other sites More sharing options...
Jeet Kune Do Posted March 3, 2011 Share Posted March 3, 2011 Como on guys, it's very important for us!Please... Link to comment Share on other sites More sharing options...
chimera247 Posted March 17, 2011 Share Posted March 17, 2011 anyone??i got the same problem, i tried following the instructions of making phone number as a required field, and applied it to date of birth, but without success, the asterisk appears next to date of birth(in grey), but the form doesn't recognize the field as required!I even inserted the date of birth in the require_text class, but without any success..Does anyone know, how to make it required?Thank you Link to comment Share on other sites More sharing options...
geekcu Posted March 17, 2011 Share Posted March 17, 2011 is it can do that? Link to comment Share on other sites More sharing options...
chimera247 Posted March 17, 2011 Share Posted March 17, 2011 yes...but it doesnt work completely... Link to comment Share on other sites More sharing options...
chimera247 Posted March 24, 2011 Share Posted March 24, 2011 YES!!!Done it!!For anyone who needs a hand, in making certain fields "required", or changing the name of any field with custom names, just send me a msg!!After changing the fields,i fixed it on the Admin side/Database, and it's perfect, so when you go in the users details, all the fields are now displayed correctly!And i also made the Date of Birth(birthday) a required field!(with the red asterisk) Link to comment Share on other sites More sharing options...
chimera247 Posted March 24, 2011 Share Posted March 24, 2011 My customer's language is Italian, but i did this anyway!! Link to comment Share on other sites More sharing options...
babyewok Posted June 14, 2011 Share Posted June 14, 2011 chimera247, could you please post your solution on here? Link to comment Share on other sites More sharing options...
chimera247 Posted June 14, 2011 Share Posted June 14, 2011 contact me with PM, i can definetly help you guys out!!thanks Link to comment Share on other sites More sharing options...
babyewok Posted June 15, 2011 Share Posted June 15, 2011 I have PM'd you! Link to comment Share on other sites More sharing options...
chimera247 Posted July 4, 2011 Share Posted July 4, 2011 Ok....i will post my DOB fields: That's simple you have to modify these 3 files Inside your THEME FOLDER change these file 1)in authentication.tpl replace your Birthday Class with this: {l s='Birthday'} - {foreach from=$days item=day} {$day|escape:'htmlall':'UTF-8'} {/foreach} {* {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'} *} - {foreach from=$months key=k item=month} {l s="$month"} {/foreach} -{foreach from=$years item=year} {$year|escape:'htmlall':'UTF-8'} {/foreach} <sup>*</sup> 3)identity.tpl once more replace the DOB CLASS with this: {l s='Birthday'} - {foreach from=$days item=v} {$v|escape:'htmlall':'UTF-8'} {/foreach} {* {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'} *} - {foreach from=$months key=k item=v} {l s="$v"} {/foreach} - {foreach from=$years item=v} {$v|escape:'htmlall':'UTF-8'} {/foreach} <sup>*</sup> That's it!! Should work...if it gives you problems just let me know… always really busy, excuse for the answer after many days! Link to comment Share on other sites More sharing options...
matko Posted July 6, 2011 Share Posted July 6, 2011 Hallo chimera247,You wrote 3 files: but provides only 2 files:1, authentication.tpl2, ?3, identity.tplWith this 2 files, it don´t work for me (prestashop 1.4).It just make asterisk, but not working properly after submit registration form.Thank you for you hints.Kind Regardsmatkomatko Link to comment Share on other sites More sharing options...
MarkAngelo Posted July 27, 2011 Share Posted July 27, 2011 Hi, This is so far the best shopping cart experience I've had, until we reached this error. We are using 1.4 and have already finished the site. Once we clicked to require the birthday, it does not allow users to go past this section even when they input a birthday. Will someone please tell me which files to update. Thank you, Mark Link to comment Share on other sites More sharing options...
jtlswanson Posted September 18, 2011 Share Posted September 18, 2011 Can anyone help? I too need this option please... Link to comment Share on other sites More sharing options...
jtlswanson Posted October 3, 2011 Share Posted October 3, 2011 Does anyone have a solution to this please? Using 1.4.4.1. Thanks! Link to comment Share on other sites More sharing options...
jtlswanson Posted October 14, 2011 Share Posted October 14, 2011 No one can help out on this one? Please? Using 1.4.4.1 Link to comment Share on other sites More sharing options...
ROB001 Posted October 27, 2011 Share Posted October 27, 2011 Ok....i will post my DOB fields: That's simple you have to modify these 3 files Inside your THEME FOLDER change these file 1)in authentication.tpl replace your Birthday Class with this: {l s='Birthday'} - {foreach from=$days item=day} {$day|escape:'htmlall':'UTF-8'} {/foreach} {* {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'} *} - {foreach from=$months key=k item=month} {l s="$month"} {/foreach} -{foreach from=$years item=year} {$year|escape:'htmlall':'UTF-8'} {/foreach} <sup>*</sup> 3)identity.tpl once more replace the DOB CLASS with this: {l s='Birthday'} - {foreach from=$days item=v} {$v|escape:'htmlall':'UTF-8'} {/foreach} {* {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'} *} - {foreach from=$months key=k item=v} {l s="$v"} {/foreach} - {foreach from=$years item=v} {$v|escape:'htmlall':'UTF-8'} {/foreach} <sup>*</sup> That's it!! Should work...if it gives you problems just let me know… always really busy, excuse for the answer after many days! Hi, You mention there was three files to update. What would the second one be? Thanks, Rob. Link to comment Share on other sites More sharing options...
mike71125 Posted December 7, 2011 Share Posted December 7, 2011 I am also having the same problem. please help1 Link to comment Share on other sites More sharing options...
jtlswanson Posted January 9, 2012 Share Posted January 9, 2012 Still no one can offer the 2nd part to the DOB required configuration file listed above?! Pretty please?!?!?! Now using 1.4.6.2... Link to comment Share on other sites More sharing options...
genox Posted January 21, 2012 Share Posted January 21, 2012 I am also stuck here.. Is there no one of the devs who could point to a solution? Hello? Link to comment Share on other sites More sharing options...
hxd Posted January 22, 2012 Share Posted January 22, 2012 Actually, you don't have to modify any code to make the birtday field required. You can do this from the back office of your PrestaShop. Go to Customers tab, then click on the button Set required fields for this section (it's at the bottom of the page). In the table that appears mark the checkbox in front of birthday and click on the Save button. That's it. On the registration form the field won't be marked with a red asterisk, but it will still be required. If the customer doesn't select a birthday (all three drop-down menus), he/she won't be able to register, and a message in red will be displayed that the birthday is required. In case you want to put a red asterisk you have to modify the code of the authentication.tpl file for the particular theme. Find the following string of code: <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> It's closer to the end of the file. Don't get confused because there's a similar string of code at the beginning of the file. You can put a red asterisk only after the last drop-down menu (for the year), or you can put an asterisk after each of the three drop down menus. To put a red asterisk after the last drop-down menu insert the following piece of code between the tags </select> and </p> (at the end of the code): <sup style="color:red;">*</sup> To put an asterisk after the other drop-down menus just put the same code after the other two </select> tags. Don't forget that when you make changes to template files you should enable the force compile setting from the back office (Preferences tab>Performance sub-tab), so that you can see the changes when refreshing the frontend. Disable it after you're done. Hope this helps. 4 Link to comment Share on other sites More sharing options...
CyberLolita Posted January 22, 2012 Share Posted January 22, 2012 Thanks HXD!! Can't believe I never noticed that at the bottom of the page *embarassed* Link to comment Share on other sites More sharing options...
bjp Posted September 12, 2012 Share Posted September 12, 2012 Thank you hxd, this works fine for birthday, however I tried to require id_gender and is not being required. Any idea why? Link to comment Share on other sites More sharing options...
RobboR Posted November 27, 2012 Share Posted November 27, 2012 (edited) Following HXD's instructions i realised that in Customers configuration i hadn't the field i was interested to so I edited PS_ROOT/controllers/admin/AdminCustomersController.php file adding a new parameter in required_fields: from $this->required_fields = array('newsletter','optin'); in $this->required_fields = array('newsletter','optin', 'id_gender'); I don't know why but the same editing doesn't work in override/controllers/admin/AdminCustomersController.php file (please let me know if someone knows how override properly this class in override file!) Hope this help! Edited November 27, 2012 by RobboR (see edit history) Link to comment Share on other sites More sharing options...
MGLimhamn Posted September 18, 2013 Share Posted September 18, 2013 Actually, you don't have to modify any code to make the birtday field required. You can do this from the back office of your PrestaShop. Go to Customers tab, then click on the button Set required fields for this section (it's at the bottom of the page). In the table that appears mark the checkbox in front of birthday and click on the Save button. That's it. I don't have birthday as an option there, I only have: - newsletter -optin How can I add birthday to the list so I can make it a required field? 1 Link to comment Share on other sites More sharing options...
MGLimhamn Posted November 13, 2013 Share Posted November 13, 2013 (edited) Anyone know? Edited November 13, 2013 by MGLimhamn (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now