Can telephone number be made mandatory during checkout?
Any help gratefully received.
Thanks
Rob.
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.
<input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" />
change the above code to
<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.
If you think someone's answer helped, please give him/her a Positive Reputation vote by liking their post.
E-commerce hosting from Scotserve, fast, reliable and affordable.
One problem with this is that the "phone" is not required when changing the address via the "Update Address" in My Account
Remember to change it in address.tpl in your theme directory also, as there is no asterix on there either:
Around line 87...
Change:
<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:
<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
I 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 fantastic
I'm using prestashop 1.2.5 and I have tried it on a clean install of prestashop as well just to check
If you think someone's answer helped, please give him/her a Positive Reputation vote by liking their post.
E-commerce hosting from Scotserve, fast, reliable and affordable.
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?
I 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?
Attached Files
Quote
protected $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city', 'county');
change it to
protected $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
JC, Phone Service Mgr
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
From 1291758648:
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?
Phone number is not listed in $fieldsRequired in Address.php, so some other code is making it required. How to make it NOT required in 1.4?
Try to edit your classes/address.php from:
<input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" />
*
to:
<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:
<input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" />
*
to:
<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
I also found this bit of code in AddressController.php that may also be making phone number required. When I commented this out, I still got the required error though. They really did something to make it difficult to make phone number NOT required, didn't they?
if (!Tools::getValue('phone') AND !Tools::getValue('phone_mobile'))
$this->errors[] = Tools::displayError('You must register at least one phone number');J. -- your recommendation will not work with 1.4. It's much different.



Back to top










