1

I'm actually using a payment filter by customer group extension on my magento 1.9 CE. That let me control which payment method can have access my clients based on their customer group. Unfortunately this filter doesn't seem to apply to Paypal Express (it shows up anyway for all clients). Any idea?

Mod edit: extension code publicly available on GitHub.

0

Well, I found the solution. I'll share it others.

In case you need this extension for PayPal (Magento CE 1.7.0) some minor changes would do the trick:

N98_CustomerGroupCheckout_Block_Adminhtml_System_Config_Form
OLD:
if (isset($subGroup->fields)) {
$this->_addFieldToConfigGroup($subGroup);
}
NEW:
if (isset($subGroup->fields)) {
if($subGroup->getName()!='account' && substr($subGroup->getName(),0,6)!='paypal'){
$this->_addFieldToConfigGroup($subGroup);
}
if(isset($subGroup->fields->wps)) {
$this->_addFieldToConfigGroup($subGroup->fields->wps);
}
if(isset($subGroup->fields->express_checkout)) {
$this->_addFieldToConfigGroup($subGroup->fields->express_checkout);
}
}
N98_CustomerGroupCheckout_Model_Payment_Observer
OLD:
if ($paymentMethodInstance instanceof Mage_Paypal_Model_Standard) {
$customerGroupConfig = Mage::getStoreConfig('paypal/wps/' . self::XML_CUSTOMER_GROUP_CONFIG_FIELD);
} elseif ($paymentMethodInstance instanceof Mage_Paypal_Model_Express) {
$customerGroupConfig = Mage::getStoreConfig('paypal/express/' . self::XML_CUSTOMER_GROUP_CONFIG_FIELD);
} elseif ($paymentMethodInstance instanceof Mage_GoogleCheckout_Model_Payment) {
$customerGroupConfig = Mage::getStoreConfig('google/checkout/' . self::XML_CUSTOMER_GROUP_CONFIG_FIELD);
} else {
$customerGroupConfig = $paymentMethodInstance->getConfigData(self::XML_CUSTOMER_GROUP_CONFIG_FIELD);
}
NEW:
if ($paymentMethodInstance instanceof Mage_Paypal_Model_Standard) {
$customerGroupConfig = Mage::getStoreConfig('payment/wps/' . self::XML_CUSTOMER_GROUP_CONFIG_FIELD);
} elseif ($paymentMethodInstance instanceof Mage_Paypal_Model_Express) {
$customerGroupConfig = Mage::getStoreConfig('payment/express_checkout/' . self::XML_CUSTOMER_GROUP_CONFIG_FIELD);
} elseif ($paymentMethodInstance instanceof Mage_GoogleCheckout_Model_Payment) {
$customerGroupConfig = Mage::getStoreConfig('google/checkout/' . self::XML_CUSTOMER_GROUP_CONFIG_FIELD);
} else {
$customerGroupConfig = $paymentMethodInstance->getConfigData(self::XML_CUSTOMER_GROUP_CONFIG_FIELD);
}

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.