Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

magento payment methods - enable for admin only

Tags:

magento

I need to enable the Cheque / Money Order payment method to enable our clients call centre team to create orders in the admin.

However we do not want customers buying online through the website to use this payment method.

Does anybody know how I might be able to do this?

Regards, Fiona

like image 246
Fiona Avatar asked Jan 18 '10 11:01

Fiona


People also ask

Which payment method is by default enabled for Magento store?

Similarly to the previous payment methods, "Check / Money Order" does not require an online payment to be processed, it will allow you to accept payments by checks or money orders. This payment method is enabled by default in Magento.

How do I change the default payment method in Magento 2?

To set default payment method in Magento checkout: Go to Stores > Configuration > Magefan Extension > Better Checkout. Set the Default Payment Method in the General Configuration section.

Which one of the following options are the default payment methods in Magento 2?

Authorize.net is one of the most popular onsite payment gateways that is included into Magento 2 by default. Generally, it allows customers finish the checkout process without leaving a website. All customers' information is transfer through a security gateway.


1 Answers

Two options:

1)
Override (using never change the original or add a /local/Mage/ override) the payment method (or just modify it if it's your own method), and add this:

protected $_canUseInternal              = true;
protected $_canUseCheckout              = false; 
protected $_canUseForMultishipping      = false;

2)
Create an observer on the frontend for "payment_method_is_active" event, and set to inactive the methods you don't want to show on the frontend:

   <config>
       <frontend>
           <events>
        <payment_method_is_active>
            <observers>
                       ... your observer here


 public function your_observer($event){

      $method = $event->getMethodInstance();
      $result = $event->getResult();

      if( $method should not be active in frontend ){

            $result->isAvailable = false;
      }

 }
like image 75
Enrique Avatar answered Sep 22 '22 02:09

Enrique