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?

  • what are the code for payment method. ? – Qaisar Satti Dec 10 '15 at 7:57
  • is there any way to find the code ? – Baby in Magento Dec 10 '15 at 7:59
  • inspect element and you will find that code. it is after id="p_method_ {here is code} – Qaisar Satti Dec 10 '15 at 8:00
  • Let me get this straight. You want the payment method enabled but not available to the checkout proccess? What for? – Yiorgos Moschovitis Dec 10 '15 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 '15 at 8:05
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" />
  • i got the payment method code, in which file , i have to add the above if condition? – Baby in Magento Dec 10 '15 at 8:03
  • Checkout/onepage/payment/method.phtml – Qaisar Satti Dec 10 '15 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 ?>">

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.