Jump to content

mobile phone field doesn't work when required


Recommended Posts

Hey,

 

Basically, I want every client to fill their mobile phone number when creating an account during order (instant checkout disabled).

 

This is how my checkout form looks like

1e7ec1e3ccc417438489c6b6b5a4dd63.png

 

I moved the phone number up, by adding this code to a "new customer section" of order-opc-new-account.tpl 

<p class="required text">
<label for="phone_invoice">{l s='Home phone'} <sup>*</sup></label>
<input type="text" class="text" name="phone_invoice" id="phone_invoice" value="{if isset($guestInformations) && $guestInformations.phone_invoice}{$guestInformations.phone_invoice}{/if}" />
</p>

and changed the line in adresses.php to 

 

'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'required' => true, 'size' => 32),

 

When I try to register and I get this:

 

There is 1 Error(s):

  1. Phone is rquired.

 

 

Enabling "force users to enter at least one phone" option in Prefrences->clients is not an option for me, but even when I do it it doesn't work either. It gives me an error as well. 

 

Any help is highly appreciated.

 

 

UPDATE

 

Solved :)

 

<p class="required text">
<label for="phone_invoice">{l s='Home phone'} <sup>*</sup></label>
<input type="text" class="text" name="phone_invoice" id="phone_invoice" value="{if isset($guestInformations) && $guestInformations.phone_invoice}{$guestInformations.phone_invoice}{/if}" />
</p>

 

replaced with

 

<p class="required text"> 
<label for="phone">{l s='Home phone'} <sup>*</sup></label>
<input type="text" class="text" name="phone" id="phone" value="{if isset($guestInformations) && $guestInformations.phone}{$guestInformations.phone}{/if}" />
</p>
Edited by axelfx07 (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...