Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

mouseovers on checkout_payment options


TerryK

Recommended Posts

I've had a few instances where orders have come through with 'Money Order' or 'Pay by Phone' as the selected payment method, yet the customer later contacts me to tell me they entered their credit card info.

 

I'm guessing that what happens is they've accidentally clicked somewhere in the field for the other two payment options, which will then set that option as the selected one, resulting in cc info not coming through.

 

I'd like to allow the JS to highlight the text for each payment method as it's moused over, but NOT change the payment method unless they actually click the radio button, rather than anywhere on the line. Can anyone help me figure out which of the following code I need to get rid of to accomplish this?

 

<script language="javascript"><!--
var selected;

function selectRowEffect(object, buttonSelect) {
 if (!selected) {
   if (document.getElementById) {
     selected = document.getElementById('defaultSelected');
   } else {
     selected = document.all['defaultSelected'];
   }
 }

 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;

// one button is not an array
 if (document.checkout_payment.payment[0]) {
   document.checkout_payment.payment[buttonSelect].checked=true;
 } else {
   document.checkout_payment.payment.checked=true;
 }
}

function rowOverEffect(object) {
 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
//--></script>

 

and possibly something in here has to be deleted too?

 

<?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";
   } else {
     echo '                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
   }
?>

 

Thanks in advance...

 

Terry

Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Link to comment
Share on other sites

I do have the option buttons on the left side, but would still like to keep the mouseover highlight -- just not the click anywhere and change method JS that's in place.

 

Anyone?

 

Thanks,

 

Terry

Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Link to comment
Share on other sites

Have got the solution to this, in case anyone else wants it.

 

Look for this code:

 

<?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";
  } else {
    echo '                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
  }
?>

 

Change to:

 

<?php
  if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {
    echo '                  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
  } else {
    echo '                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
  }
?>

 

That's all there is to it. Hopefully I'll now have happier customers who swear they entered their CC info even though the order came through as money order... If you find you're getting a lot of non-Credit Card orders when you have multiple payment options, your customers may be having the same problem. I think it's a change worth making.

 

Terry

Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...