2

I'm trying to change the selected payment option in the checkout and noticed its being checked with this:

<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?>

I'm presuming getSelectedMethodCode is coming from the admin somewhere? If so does anyone know where it's being set please?

1

Goto methods.phtml at app/design/frontent/yourpackage/your template/template/checkout/onepage/payment/

AND find

<input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" /></span>
        <?php $oneMethod = $_code; ?>

and here you need put your logic.

<?php if($_code=='yourpayemntcode'): ?> checked="checked"   <?php endif;?>
  • Thanks but can you choose which payment option is to be pre-selected in admin? Or is this not possible? – NoDachi Nov 16 '15 at 11:57
  • You can Make Module For that , make admin select the default gateway there and fetch the value on above template and put it in the logic , there is no stock functionality for that, accept the answer as well if you found it useful – Vishwas Bhatnagar Nov 16 '15 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.