Enabling Magento payment methods for backend orders

Magento has a great, albeit lesser known feature that allows you to create orders in the backend. This is especially handy for stores that also take orders by phone because this allows them to utilize Magento’s inventory status, coupons etc. but the order is also registered in Magento’s statistics, providing a clearer picture.

Sadly there aren’t that many payment methods that allow transactions from the backend of Magento. Of course this is because in most cases this would require you to know the payment data of your client. In my case a client of mine wanted to create orders in the backend for the customers who would order by phone, come to the store to pick up the order and pay in cash. To achieve this I copied ‘/app/code/core/Mage/Payment/Model/Method/Purchaseorder.php’ to the local pool and added these two lines in the body of the class.

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

The first variable allows the payment method to be used in the backend if set to true. The second blocks it from being used in the frontend if set to false. So If you still want to use purchase order to be used in the frontend just set it to true.

I’ve picked purchase order because this allows my client to give the order some identifier so it’s easier to recognize afterwards. Of course you can pick just about any payment method that is available, however keep in mind that if a payment method works in the front end it doesn’t necessarily work in the backend.

5 Replies to “Enabling Magento payment methods for backend orders”

  1. Hi Luc,

    Thank you for sharing the information.
    I was reading this and trying to figure out what you did.

    So you copied the file and placed it in “the local pool” but which folder is this where can I trace back the steps you made?

    Thanks.

    Steve

    1. With local pool I mean the local folder in /app/code. You don’t want to edit core files and lose your alterations with upgrades. If you copy the required files/folders from the core folder to the local folder you can safely edit those and still run updates ( as long as the extension isn’t changed significantly ).

  2. Hi,

    Got this working fine. Just what I have been looking for, but is it possible to have it then update the transaction log with the payment details.

    Regards

    Mike

Comments are closed.