1

enter image description here
we are using custom payment module. we want to keep that payment method enable .

but we don't want to show this payment under Checkout > payment method. so we deleted the design part of that module.

but the Radio button is still displaying under "payment method " at the last.

How to Hide that radio button only for that payment method?

8
  • what are the code for payment method. ? Dec 10, 2015 at 7:57
  • is there any way to find the code ? Dec 10, 2015 at 7:59
  • inspect element and you will find that code. it is after id="p_method_ {here is code} Dec 10, 2015 at 8:00
  • Let me get this straight. You want the payment method enabled but not available to the checkout proccess? What for? Dec 10, 2015 at 8:01
  • 2
    Go admin side : System ->Configuration -> Payment Methods ( Your custom method If Enable Yes then cahnge to: NO and save)
    – Abdul
    Dec 10, 2015 at 8:05

2 Answers 2

1

you can add if condition on payment method code

 <input id="p_method_<?php echo $_code ?>" <?php if($_code=='yourcode') { ?> style="display:none"<?php } ?> value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" onclick="payment.switchMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
2
  • i got the payment method code, in which file , i have to add the above if condition? Dec 10, 2015 at 8:03
  • Checkout/onepage/payment/method.phtml Dec 10, 2015 at 8:36
1

In

app/design/frontend/PACKAGE/THEME/template/checkout/onepage/payment/methods.phtml

near line 44 you will find

    foreach ($methods as $_method):
         $_code = $_method->getCode();
         ?>
         <dt id="dt_method_<?php echo $_code ?>">

Change it to

    foreach ($methods as $_method):
        $_code = $_method->getCode();
        if($_code == 'YOUR_CODE'){continue;}//add this line
        ?>
        <dt id="dt_method_<?php echo $_code ?>">
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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