Adding a "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.
Log into your USAePay merchant gateway. Go to “Settings”, then “Source Keys”. Select the source key you are using and click “Edit”. Click “Edit Customization to Epay Form”.
Click in the text box, then hit Ctrl-F on your keyboard to search the text. Search for “Shipping Information”. It should take you to a portion of code that looks like:
<td bgcolor="#C4C7D4" width="692" colspan="2"><b><font face="Verdana">Shipping Information:</font></b></td>
Add the following code to the next line:
<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>
Insert a new line and add the following between <script> and </script> tags:
var form = document.epayform;
Save the changes to your form. This will create a checkbox on your payment form that looks like this:
Once you have saved changes to your payment form, you will be able to instantly fill out the Shipping fields with Billing information.