0

I am trying to hide some specific payment method from frontend only. I have tried with observer and plugin. Both working fine if my di.xml and events.xml placed in global config i.e

app/code/Vendor/Module/etc/di.xml

app/code/Vendor/Module/etc/events.xml

Problem is, if I move them to frontend they stop working.

app/code/Vendor/Module/etc/frontend/di.xml

app/code/Vendor/Module/etc/frontend/events.xml

Thanks in advance

1

I have written blog about How to Disable Payment Method in frontend only.. Please check this.. I am sure this will be very useful to you.

This module is having functionality to disable payment module from admin configuration of payment method. You just need to 'Disable in Frontend' => 'Yes' and payment method will be disable from frontend.

Check: http://kachagopal.blogspot.com/2018/08/hide-payment-method-from-front-end-in.html

  • Thank you @Gopal, for sharing tutorial. my question is why observer is not working only for front. as I can see you also put your events.xml in global and check area in observer class. – Pawan Aug 14 '18 at 2:49

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.