This shows you the differences between two versions of the page.

Link to this comparison view

merchant:epaymentform:sameasbilling [2010/03/16 11:53] (current)
hmcgowan created
Line 1: Line 1:
 +===== 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:
 +    - <code html>
 +<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:
 +    - <code html><​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:
 +    - <code java>
 +function copyBillingToShipping()
 +var form = document.epayform;​
 + ​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;​
 +  - Save the changes to your form. This will create a checkbox on your payment form that looks like this:
 +{{merchant:​sameasbillbox.gif}} \\
 +Once you have saved changes to your payment form, you will be able to instantly fill out the Shipping fields with Billing information.
merchant/epaymentform/sameasbilling.txt ยท Last modified: 2010/03/16 11:53 by hmcgowan

Page Tools