kehrli:
Hi Guys,
Great module. I've had no trouble with it, and I've used it up through 1.3.8a.
Thanks for the kind words!! Always good to hear.
kehrli:
Is there a way to have the form select credit card automatically when the form displays. Or even better, have credit card select if any data is entered into the credit card fields?
Well, this request is outside the scope of the VM payment module, however it is do-able with a quick hack. You'll have to make a change to your checkout payment template -- please see the FAQ's on how to correctly modify/override template files.
Here is the original template file: $STORE_HOME/includes/templates/template_default/templates/tpl_checkout_payment_default.php
In a stock 1.3.8a installation, on line 140 of 209 of the above file you will want to change (make a new template override) of the line from this:
<?php echo zen_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $_SESSION['payment'] ? true : false), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
to something like this:
<?php echo zen_draw_radio_field('payment', $selection[$i]['id'], ( (($selection[$i]['id'] == $_SESSION['payment'])||($selection[$i]['id'] == 'virtualmerchant')) ? true : false), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
This is adding another check to the ternary for the radio button payment option display. If the payment type (id) is 'virtualmerchant', it will automatically select the VM radio button while printing the choices out, except in the case where the user has pre-selected a different payment option during their session, then the latter of the two choices on the display will be checked (depends upon how each browser will handle multiple selected radio buttons -- this is probably an html faux pas but is not the end of the world).
At any rate, it's a quick and dirty one-liner, but seems to work?
Hope this helps!