Page 1 of 1

Phone number validator plugin

PostPosted: Fri Jan 13, 2017 1:51 pm
by webface
Hi,
Can you please tell me, that the following plugin work together with OPC?
(This is a phone number validator plugin)
http://extensions.virtuemart.net/shoppe ... lds-detail
If no, is there a solution in OPC for the phone number valitation?
Thanks for your help!
Best regards,
Laszlo

Re: Phone number validator plugin

PostPosted: Fri Jan 13, 2017 3:55 pm
by admin
hello, i do not know as i haven't seen this plugin in work yet.

to modify the html of the redereded fields you can use
/components/com_onepage/themes/YOUR OPC THEME/overrides/list_user_fields (registration, shipping, etc..).tpl.php

see 3 column template which modifies all inputs.

the simplest way to add this type of logic is to use html5 code like shown here:
<input type='tel' pattern='[\+]\d{2}[\(]\d{2}[\)]\d{4}[\-]\d{4}' title='Phone Number (Format: +99(99)9999-9999)'>

i can add this to the core OPC later on per each fields (so that zip can also be validated agains a format... )

best regards, stan

Re: Phone number validator plugin

PostPosted: Sat Jan 14, 2017 9:21 am
by webface
Hi Stan,
Thanks for your reply!
I tried to search the phone input code in my used template folder (sandwitch_custom) but I could not find...
In this folder there are the following files:
-acymailing_checkbox.php
-basket.html.php
-couponField.tpl.php
-customer_info.tpl.php
-delete_form.tpl.php
-delivery_date.php
-formvalidator.php
-italian_checkbox.php
-list_payment_methods.tpl.php
-list_shipto_addresses.tpl.php
-list_user_fields.tpl.php
-list_user_fields_shipping.tpl.php
-onepage.cfg.php
-single_shipping_address.tpl.php
-update_form.tpl.php
In which files and where could i modify the phone input code? I can't find... :(
Thanks for your support!

Re: Phone number validator plugin

PostPosted: Fri Jan 27, 2017 5:07 pm
by admin
hello, i added a full html5 support for phone number styling, validation and input in version 331 that is about to be released now.

at OPC Shopper tabs at HTML5 column for phone number you can set up:

type: tel
pattern: (or add any other attributes for the input): pattern="^\d{4}-\d{3}-\d{4}$"

this pattern is equivalent to: 1234-333-4444

(adjust the pattern per your logic)

error message: Enter a phone number in format "1234-333-4444"

the same logic can be used for any other VM shopper field including ZIP and others.

if you don't have my DEV build for 331 pls write me an email and i will send it to you. i will release within the download section in folling days.

best regards, stan

Re: Phone number validator plugin

PostPosted: Sun Jan 29, 2017 10:07 am
by webface
Dear Stan,

Thank you for your excellent support, the validation now working!

Best regards,

Laszlo

Re: Phone number validator plugin

PostPosted: Wed Feb 01, 2017 12:14 pm
by admin
you are welcome,

pls note - due to legacy "placeholder" support, if the "value of the input field is exactly equal to the value of the placeholder" it will trigger an error during the checkout.

best regards, stan

Re: Phone number validator plugin

PostPosted: Thu Feb 03, 2022 1:22 pm
by martin@.....cz
Thank you for a great feature. how can I fix a pop-up error message?
The message is repeated twice. When I fill in the Custom error message, it is inserted between the two and it does not look good.
https://prnt.sc/26nu3tm