Is there a way to set a "Maximum Order Total" for PayPal, similarly to the one you can set on other payment methods (without editing core files)?
Edit: Here is the solution if anyone else is wondering how to do this.
I manned up and made a small module for this, following a tutorial and grabbing a few code snippets from different threads on here. This Module will hide the PayPal option if the cart total is above 5000 (Currency).
1. First create "app/etc/modules/PPlimit_Module.xml" with this content:
<?xml version="1.0"?>
<config>
<modules>
<PPlimit_Module>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Payment/>
</depends>
</PPlimit_Module>
</modules>
</config>
2. Create "app/code/local/PPlimit/Module/etc/config.xml" containing:
<?xml version="1.0"?>
<config>
<modules>
<PPlimit_Module>
<version>0.0.1</version>
</PPlimit_Module>
</modules>
<global>
<models>
<PPlimit_Module>
<class>PPlimit_Module_Model</class>
</PPlimit_Module>
</models>
<events>
<payment_method_is_active>
<observers>
<pplimit_module>
<type>singleton</type>
<class>PPlimit_Module/Observer</class>
<method>paymentMethodIsActive</method>
</pplimit_module>
</observers>
</payment_method_is_active>
</events>
</global>
</config>
3. Create "app/code/local/PPlimit/Module/Model/Observer.php" with this code:
<?php
class PPlimit_Module_Model_Observer
{
public function paymentMethodIsActive($observer)
{
$instance = $observer->getMethodInstance();
$result = $observer->getResult();
if ($instance->getCode() == "paypal_express" || $instance->getCode() =="paypal_standard") { //Payment Method
$total = $observer->getQuote()->getGrandTotal();
if ($total<=5000) { //Payment Limit
$result->isAvailable = true;
} else {
$result->isAvailable = false;
}
}
}
}
?>
That's it, tell me if you find a bug!