Phone number validator plugin

If you are runnig Joomla 3.x and Virtuemart 3.x please post to this forum your questions or support tickets about One Page Checkout

Phone number validator plugin

Postby webface » Fri Jan 13, 2017 1:51 pm

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
webface
 
Posts: 15
Joined: Fri Dec 16, 2016 10:58 pm

Re: Phone number validator plugin

Postby admin » Fri Jan 13, 2017 3:55 pm

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
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Phone number validator plugin

Postby webface » Sat Jan 14, 2017 9:21 am

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!
webface
 
Posts: 15
Joined: Fri Dec 16, 2016 10:58 pm

Re: Phone number validator plugin

Postby admin » Fri Jan 27, 2017 5:07 pm

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
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Phone number validator plugin

Postby webface » Sun Jan 29, 2017 10:07 am

Dear Stan,

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

Best regards,

Laszlo
webface
 
Posts: 15
Joined: Fri Dec 16, 2016 10:58 pm

Re: Phone number validator plugin

Postby admin » Wed Feb 01, 2017 12:14 pm

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
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Phone number validator plugin

Postby martin@.....cz » Thu Feb 03, 2022 1:22 pm

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
martin@.....cz
 
Posts: 7
Joined: Mon Apr 29, 2019 7:45 pm


Return to One Page Checkout for Virtuemart 3 on Joomla 3.x

cron