(ZC 1.3.7.1)
This has come up a couple of times, e.g. http://www.zen-cart.com/forum/showpost.php?p=305832
I also had the desire to auto-select whatever happened to be the first payment option in the list, but I did it in one line.
again, edit /includes/templates/template_default/templates/tpl_checkout_payment_default.php
Around line 138 change
so that it says this instead:Code:<? php echo zen_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $_SESSION['payment'] ? true : false), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
It takes advantage of the $i in the for() loop just above so logically "NOT $i" will always be boolean true for the first item in the list, and only the first item.Code:<?php echo zen_draw_radio_field('payment', $selection[$i]['id'], (!$i ? true : false), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
Have I missed something subtle? I tried it in conjunction with payment modules only being available for a certain zone / currency and it still seems to work fine :)



