Jump to content


Photo

How to Disable Payment Method Programmatically in Magento 2


  • Please log in to reply
No replies to this topic

#1 Meetanshi

Meetanshi

    Advanced Member

  • Members
  • PipPipPip
  • 535 posts

Posted 23 January 2019 - 08:45 AM

Successful E-commerce store owners have learned the balance between maintaining user experience and offering payment methods that do not load the management or be too costly for the store. The best way to gain this perfect balance is to disable payment method programmatically in Magento 2 on the checkout page. 

 

 

Method to disable payment method programmatically in Magento 2:

  1. Create events.xml at app/code/Vendor/Extension/etc/
  2. Create PaymentMethodAvailable.php at app/code/Vendor/Extension/Observer/

Get the detailed method to impose all the restrictions you want in the payment methods in Magento 2 store at https://meetanshi.com/blog/disable-payment-method-programmatically-in-magento-2/



looking for the best presta addons with outstanding support? check this: PrestaShop Modules