We are beginning to allow multi-national registrations and have the requirement to split the phone number entry in the OnePage checkout billing.
We want to add Country Code and split the rest into Area Code Number and Extension fields. Then we will need to concatenate them into one before storing them.
How would I accomplish that?
Could you not just use a hidden field and javascript? So add 2 fields, then use
onchange="phonecat()"on each to trigger a function that concatenates then values and assigns them to the pre-existing telephone field, which you have changed to betype="hidden".Something like the following in JQuery:
I’ve not tested this exact solution, but I’ve used something similar in the cart. Only the (now hidden) proper field will be passed and used.
File is
.../persistent/checkout/onepage/billing/phtmlin 1.6 (withoutpersistent/earlier). And you’ll need to define the function somewhere too.