wiredworx Posted November 6, 2009 Share Posted November 6, 2009 As the title says - does anyone know if there is a setting which makes the customer have to fill in at least one telephone number? I am having an issue as my dropshipper requires it but customers keep not filling it in! Any help gratefully received.ThanksRob. Link to comment Share on other sites More sharing options...
jhnstcks Posted November 6, 2009 Share Posted November 6, 2009 If you edit your classes/address.php file at the top is the following section of code. protected $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city', 'county'); change it to protected $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city', 'county', 'phone'); then in your theme folder edit the authentication.tpl file. {l s='Home phone'} <input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" /> change the above code to {l s='Home phone'} <input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" /> * That will display the little astrix to show that it is required field. Link to comment Share on other sites More sharing options...
wiredworx Posted November 6, 2009 Author Share Posted November 6, 2009 That's just what I was after. Thank you so much! Link to comment Share on other sites More sharing options...
esoso Posted November 13, 2009 Share Posted November 13, 2009 Thank you so much! Link to comment Share on other sites More sharing options...
Ostfarsan Posted November 21, 2009 Share Posted November 21, 2009 Thank you. Very useful for me.One problem with this is that the "phone" is not required when changing the address via the "Update Address" in My Account Link to comment Share on other sites More sharing options...
sgtbash Posted December 11, 2009 Share Posted December 11, 2009 Hey all,Remember to change it in address.tpl in your theme directory also, as there is no asterix on there either:Around line 87...Change: {l s='Home phone'} <input type="text" id="phone" name="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{else}{$address->phone|escape:'htmlall':'UTF-8'}{/if}" /> To: {l s='Home phone'} <input type="text" id="phone" name="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{else}{$address->phone|escape:'htmlall':'UTF-8'}{/if}" /> * Dan Link to comment Share on other sites More sharing options...
Drew Posted February 18, 2010 Share Posted February 18, 2010 Hi guys and girlsI have tried using the code above but for some reason I end up with this error message "There is 1 error : 1. County is required"however I have no filed called county on the sign up form if any one has any ideas on a fix that would be fantasticI'm using prestashop 1.2.5 and I have tried it on a clean install of prestashop as well just to check Link to comment Share on other sites More sharing options...
jhnstcks Posted February 18, 2010 Share Posted February 18, 2010 Delete county of the line of code. Link to comment Share on other sites More sharing options...
Drew Posted February 18, 2010 Share Posted February 18, 2010 It worked thanks very much Link to comment Share on other sites More sharing options...
SpyrosT Posted February 22, 2010 Share Posted February 22, 2010 Tnx ppl, worked great! Link to comment Share on other sites More sharing options...
dzindzilia Posted June 22, 2010 Share Posted June 22, 2010 Hi,I tried that modification. Everything worked, Except: If existing customer wants to update his profile and enters some data in the phone field, when saving he gets this error:Hack attempt (Address -> phone is empty)If nothing is entered in the phone field, so normal error message appears, that phone field has to be filled.Can you advice what should I fix to make it work correctly? Link to comment Share on other sites More sharing options...
nuttis Posted September 7, 2010 Share Posted September 7, 2010 HiI tried to do this thing for the birthday field but even if the custumer fills in their birthday an error comes up that the field is required. And also i get strange icons in the list of day/month/year.Help someone? Link to comment Share on other sites More sharing options...
bluehat09 Posted October 24, 2010 Share Posted October 24, 2010 Thank you. That was easy. Link to comment Share on other sites More sharing options...
JCKeely Posted November 6, 2010 Share Posted November 6, 2010 If you edit your classes/address.php file at the top is the following section of code.protected $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city', 'county');change it toprotected $fieldsRequired = array('id_country', 'alias', 'lastn Thanks, thought it was just me who couldn't find the instructions to force a telephone number entry! Works- thanks, JC Link to comment Share on other sites More sharing options...
Timothy Jarman Posted December 7, 2010 Share Posted December 7, 2010 Hey man thanks so so much for that. Am i right in assuming then if its not the HOME phone you want as compulsory but you want the MOBILE to be the one, then is it the code phone_mobile?Also one thing this * works but on my theme the * is in the color Red, but when i put this on the phone one it is White how do i color this Red?THanks Link to comment Share on other sites More sharing options...
peterkwok Posted December 19, 2010 Share Posted December 19, 2010 jhnstcks,great thanks for that,i am new on prestashop,and just got some order from customers,but everytime i have to confirm the phone numbers with customers,or the express company wont get the cartons,your answer help me a lot,thanks again Link to comment Share on other sites More sharing options...
Ostfarsan Posted January 25, 2011 Share Posted January 25, 2011 Hey man thanks so so much for that. Am i right in assuming then if its not the HOME phone you want as compulsory but you want the MOBILE to be the one, then is it the code phone_mobile?Also one thing this * works but on my theme the * is in the color Red, but when i put this on the phone one it is White how do i color this Red?THanks I also having this problem. Does anyone know how to do the asterix red? Link to comment Share on other sites More sharing options...
Ostfarsan Posted April 2, 2011 Share Posted April 2, 2011 Hey!Try to edit your classes/address.php from: {l s='Home phone'} <input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" /> * to: {l s='Home phone'} <input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" /> and then edit your then in your theme folder edit the authentication.tpl file from: {l s='Home phone'} <input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" /> * to: {l s='Home phone'} <input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" /> I have not tested yet, but I think it will work.Regards,J Link to comment Share on other sites More sharing options...
zapsonline Posted April 28, 2011 Share Posted April 28, 2011 Hey man thanks so so much for that. Am i right in assuming then if its not the HOME phone you want as compulsory but you want the MOBILE to be the one, then is it the code phone_mobile?Also one thing this * works but on my theme the * is in the color Red, but when i put this on the phone one it is White how do i color this Red?THanks I also having this problem. Does anyone know how to do the asterix red? use "*" instead of "*" Link to comment Share on other sites More sharing options...
jaimeweb Posted September 3, 2011 Share Posted September 3, 2011 Hi All, I am on 1.2.5. I followed these steps to make Home Phone required on sign up. Which works fine. However if a customer trys to edit or add an address through their account or by my on the admin back office I see this error: Hack attempt (Address -> phone is empty) Can anyone help please as this is a major problem for me. Thanks Jaime Link to comment Share on other sites More sharing options...
jaimeweb Posted September 5, 2011 Share Posted September 5, 2011 Anyone? Link to comment Share on other sites More sharing options...
bluehat09 Posted September 5, 2011 Share Posted September 5, 2011 Anyone? @ jaimeweb Look at the whole topic and be careful to change everywhere: address.tpl and address.php class Link to comment Share on other sites More sharing options...
jaimeweb Posted September 7, 2011 Share Posted September 7, 2011 I have done. It seems that if i try to edit an address that was created before i made the amendment to the phone feild required it shows the error: Hack attempt (Address -> phone is empty) But if i try edit an address that was created after the amendment it works. Any ideas? Link to comment Share on other sites More sharing options...
jaimeweb Posted September 10, 2011 Share Posted September 10, 2011 I can't believe no one can help on this matter.... 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