This shows you the differences between two versions of the page.
merchant:epaymentform:discountcode [2012/05/15 13:37] jpresley |
merchant:epaymentform:discountcode [2012/05/15 13:51] (current) jpresley |
| | | | |
| | var discounttotal = document.epayform.UMdiscount.value; | | var discounttotal = document.epayform.UMdiscount.value; |
| - | document.epayform.UMdiscount.value = discounttotal; | + | if (discounttotal != 0) |
| - | document.getElementById('discount').innerHTML = "$" + currencyFormatted(discounttotal); | + | { |
| | + | document.getElementById('discount').innerHTML = "$" + currencyFormatted(discounttotal); |
| | + | } |
| | | | |
| | var total = subtotal - discounttotal; | | var total = subtotal - discounttotal; |
| | | | |
| | ===== Add HTML ===== | | ===== Add HTML ===== |
| | + | Find |
| | + | <code html> |
| | + | <body link="#000080" vlink="#000080" alink="#000080" text="#000000" bgcolor="#D4D7E4"> |
| | + | </code> |
| | + | |
| | + | and replace it with |
| | + | <code html> |
| | + | <body link="#000080" vlink="#000080" alink="#000080" text="#000000" bgcolor="#D4D7E4" onload="calculateTotal()"> |
| | + | </code> |
| | | | |
| | Find the part of the form with the hidden inputs. It should look like this: | | Find the part of the form with the hidden inputs. It should look like this: |
| | <tr> | | <tr> |
| | <td bgcolor="#F0F0F0" width="234" align="right"><font size="2" face="Verdana">Total Charge:</font></td> | | <td bgcolor="#F0F0F0" width="234" align="right"><font size="2" face="Verdana">Total Charge:</font></td> |
| - | <td bgcolor="#F0F0F0" width="450"><input type="hidden" name="UMamount" value="[UMamount]"><div id="totalamount">$20.00</div> | + | <td bgcolor="#F0F0F0" width="450"><input type="hidden" name="UMamount" value="[UMamount]"><div id="totalamount"> </div> |
| | </td> | | </td> |
| | </tr> | | </tr> |
| | </code> | | </code> |