Payment method details are hidden unless payment method is selected. #18

Closed
wants to merge 1 commit into from
View
20 catalog/checkout_payment.php
@@ -87,9 +87,9 @@
?>
<script type="text/javascript"><!--
-var selected;
+var selected, obj, prev_selected = '<?php echo $payment ?>';
-function selectRowEffect(object, buttonSelect) {
+function selectRowEffect(object, buttonSelect, module_code) {
if (!selected) {
if (document.getElementById) {
selected = document.getElementById('defaultSelected');
@@ -98,6 +98,16 @@ function selectRowEffect(object, buttonSelect) {
}
}
+ if (prev_selected) {
+ document.getElementById('collation_' + prev_selected).style.display = 'none';
+ }
+ if (obj = document.getElementById('collation_' + module_code)) {
+ prev_selected = module_code;
+ obj.style.display = 'table';
+ } else {
+ prev_selected = '';
+ }
+
if (selected) selected.className = 'moduleRow';
object.className = 'moduleRowSelected';
selected = object;
@@ -195,9 +205,9 @@ function rowOutEffect(object) {
<?php
if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {
- echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+ echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ', \'' . $selection[$i]['id'] . '\')">' . "\n";
} else {
- echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+ echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ', \'' . $selection[$i]['id'] . '\')">' . "\n";
}
?>
@@ -228,7 +238,7 @@ function rowOutEffect(object) {
?>
<tr>
- <td colspan="2"><table border="0" cellspacing="0" cellpadding="2">
+ <td colspan="2"><table border="0" cellspacing="0" cellpadding="2" id="collation_<?php echo $selection[$i]['id'] ?>"<?php echo $selection[$i]['id'] != $payment ? ' style="display: none;"' : '' ?>>
<?php
for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {