1

I would like to make the Purchase Order method of payment accessible only in admin order creation, and not visible in the front end checkout process.I am using the rwd theme and do not program so please be clear which files I need to amend and where if possible. Thank you.

  • do you want to create an order using payment method in admin area? – Baby in Magento Dec 12 '15 at 7:35
1

Actually not that difficult to achieve.

Payment methods models contain certain properties, which determine their functionality.

Have a look at Mage_Payment_Model_Method_Abstract and you can get a full list of properties, and the defaults.

The three of interest will be:

 protected $_canUseInternal             
 protected $_canUseCheckout              
 protected $_canUseForMultishipping     

canUseInternal = admin

So, to enable/disable a payment method for the area, simply set the appropriate flag.

A mini tutorial, since you mention you are not a developer:

Install n98-magerun

In the root of the site run the command:

n98-magerun.phar dev:module:create --add-all ProxiBlue AdminOnlyPayments community

This will create the extension base folder structure, located here: /app/code/community/ProxiBlue/AdminOnlyPayments

Edit the file: /app/code/community/ProxiBlue/AdminOnlyPayments/etc/config.xml

and change this section:

<models>
        <proxiblue_adminonlypayments>
            <class>ProxiBlue_AdminOnlyPayments_Model</class>
        </proxiblue_adminonlypayments>
    </models>

to

<models>
   <proxiblue_adminonlypayments>
     <class>ProxiBlue_AdminOnlyPayments_Model</class>
   </proxiblue_adminonlypayments>
<payment>
 <rewrite>
              <method_purchaseorder>ProxiBlue_AdminOnlyPayments_Model_Method_Purchaseorder</method_purchaseorder>
 </rewrite>
</payment>  

Create the file /app/code/community/ProxiBlue/AdminOnlyPayments/Model/Method/Purchaseorder.php

and place the following contents:

class ProxiBlue_AdminOnlyPayments_Model_Method_Purchaseorder extends Mage_Payment_Model_Method_Purchaseorder
{

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

}

Hope that helps

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.