ableier Posted September 4, 2015 Share Posted September 4, 2015 Hi all, My guest checkout has suddenly become unusable. When completing the form there is an error saying that a phone number is required. The only field available to fill is Mobile Phone. Even if there is a number in mobile phone it throws the same error, "Phone number required". Phone Number is Mandatory is turned to off in the BO. It also shows Null in the DB. I've replaced authentication.tpl, address.tpl and addresses.tpl with fresh pages with no results. I found the following closed thread: https://www.prestashop.com/forums/topic/322195-guess-checkout-mobile-phone-field-required-get-error-phone-is-required/ Please, does anyone have an idea on what could be going on here!? On a side note, I also have a zip code error, although it doesn't affect the sign up. It just shows red when entered. I also removed any zip code validation from Localization > Countries. I don't know if these are related. Here is the thread for that issue: https://www.prestashop.com/forums/topic/465629-postal-code-error-after-updating-to-1611/ PS 1.6.1.0 United States Link to comment Share on other sites More sharing options...
NemoPS Posted September 5, 2015 Share Posted September 5, 2015 DId you install any new module? Are you using any override for the address class/controller? Link to comment Share on other sites More sharing options...
David Eschmeyer Posted February 2, 2016 Share Posted February 2, 2016 you can always fix the phone field themes/yourtheme/order-opc-new-account.tpl line 250 in default-bootstrap for 1.6.1.4 <div class="form-group is_customer_param"> [10:46] is_customer_param is the problem... if it is removed then guest checkout is fixed showing both phone fields Then your validation will work. If you dont have an override then perhaps someone altered /classes/Address.php and set phone to required in the definitions... In any case now this is fixed because the guest checkout has the phone field too. The above fix is for 1 page checkout. 1 Link to comment Share on other sites More sharing options...
David Eschmeyer Posted February 2, 2016 Share Posted February 2, 2016 for standard 5 step GUEST checkout, you can add the field in themes/yourtheme/Authentication.tpl insert this at line 272 <p class="form-group"> <label for="phone">{l s='Home phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label> <input type="text" class="form-control" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" /> </p> (just before mobile phone) Link to comment Share on other sites More sharing options...
David Eschmeyer Posted February 2, 2016 Share Posted February 2, 2016 for forced require validation... classes/address.php definitions array... you can add or remove required => true example: 'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'required' => true, 'size' => 32), 'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), here i force home phone, but dont care about cell. This satisfies the setting at least 1 phone number required as well. Link to comment Share on other sites More sharing options...
khejit68 Posted February 3, 2016 Share Posted February 3, 2016 you can always fix the phone field themes/yourtheme/order-opc-new-account.tpl line 250 in default-bootstrap for 1.6.1.4 <div class="form-group is_customer_param"> [10:46] is_customer_param is the problem... if it is removed then guest checkout is fixed showing both phone fields Then your validation will work. If you dont have an override then perhaps someone altered /classes/Address.php and set phone to required in the definitions... In any case now this is fixed because the guest checkout has the phone field too. The above fix is for 1 page checkout. Thanks, I solved my old problem. I removed is_customer_param from order-opc-new-account.tpl, but I added class hidden instead, because I just want to hide the input I don't use. I also removed 'required'=>true from definition in Address class, from both phones, because I don't want this to be obligatory. Before that fix I had whole div containing first phone removed from both occurences in order-opc-new-account.tpl. It was okay, but when customer got to guest checkout, left for some more shopping and came back to guest checkout, there was an error about phone being invalid. Now the error is gone, but field for first phone is invisible anyway I remember the solution consisting of removing unused phone from definition array in Address class, but I wouldn't recommend it. I'm not sure about security of this, and this is core manipulation. Link to comment Share on other sites More sharing options...
David Eschmeyer Posted February 4, 2016 Share Posted February 4, 2016 as per making the 2nd phone show, dont forget it has to be done further down the tpl too for the invoice address if different from shipping address. Almost forgot that Link to comment Share on other sites More sharing options...
Lloyd966 Posted November 14, 2016 Share Posted November 14, 2016 Hi, does the fix below work for step 2 - Sign in for a guest checkout or just step 3 Address you can always fix the phone field themes/yourtheme/order-opc-new-account.tpl line 250 in default-bootstrap for 1.6.1.4 <div class="form-group is_customer_param"> Link to comment Share on other sites More sharing options...
Lloyd966 Posted November 14, 2016 Share Posted November 14, 2016 If your are trying to fix this error in the 5 step checkout for a guest checkout, as discussed in the post above - Posted 02 February 2016 - 10:52 AM, not only will you have to add those lines (just before mobile phone). you will also have to add the following {if isset($one_phone_at_least) && $one_phone_at_least} {assign var="atLeastOneExists" value=true} <p class="inline-infos required">** {l s='You must register at least one phone number.'}</p> {/if} (just after mobile phone) Hope this Helps. Link to comment Share on other sites More sharing options...
Recommended Posts