Same as Billing Checkbox
This code will allow you to add a box to your form that automatically duplicates the Billing information for use in the Shipping fields. This will save your customers some time while filling out the form.
When complete, the checkbox will look like this:
HTML
Search for "Shipping Information". It should take you to a portion of code that looks like this:
<tr>
<td bgcolor="#C4C7D4" width="692" colspan="2"><b><font face="Verdana">Shipping Information:</font></b></td>
</tr> </code>
Add the following code to the next line:
<tr>
<td bgcolor="#F0F0F0" width="234" align="right"><font face="Verdana" size="2">Same as Billing:</font></td>
<td bgcolor="#F0F0F0" width="450">
<input type="checkbox" name="shipsameasbill" size="28" value="yes" onClick="copyBillingToShipping()"></td>
</tr>
Insert a new line and add the following between <nowiki><script>
and </script></nowiki>
tags:
function copyBillingToShipping()
{
var form = document.epayform;
if(form.shipsameasbill.checked)
{
form.UMshipcompany.value=form.UMbillcompany.value;
form.UMshipfname.value=form.UMbillfname.value;
form.UMshiplname.value=form.UMbilllname.value;
form.UMshipcompany.value=form.UMbillcompany.value;
form.UMshipstreet.value=form.UMbillstreet.value;
form.UMshipstreet2.value=form.UMbillstreet2.value;
form.UMshipcity.value=form.UMbillcity.value;
form.UMshipstate.value=form.UMbillstate.value;
form.UMshipzip.value=form.UMbillzip.value;
form.UMshipcountry.value=form.UMbillcountry.value;
form.UMshipphone.value=form.UMbillphone.value;
}
}
Once you have saved changes to your payment form, you will be able to instantly fill out the Shipping fields with Billing information.