Following code return customer group, how to add condition if customer group "Tester" then only show selected payment gateway?
app\etc\modules\Gta_FindPaymentGateway.xml
<?xml version="1.0"?>
<config>
<modules>
<Gta_FindPaymentGateway>
<codePool>local</codePool>
<active>true</active>
</Gta_FindPaymentGateway>
</modules>
</config>
app\code\local\Gta\FindPaymentGateway\etc\config.xml
<?xml version="1.0"?>
<config>
<modules>
<Gta_FindPaymentGateway>
<version>1.0.0</version>
</Gta_FindPaymentGateway>
</modules>
<global>
<models>
<gta_findpaymentgateway>
<class>Gta_FindPaymentGateway_Model</class>
</gta_findpaymentgateway>
</models>
<events>
<checkout_cart_product_add_after>
<observers>
<Gta_FindPaymentGateway_Model_Observer>
<type>singleton</type>
<class>Gta_FindPaymentGateway_Model_Observer</class>
<method>paymenter</method>
</Gta_FindPaymentGateway_Model_Observer>
</observers>
</checkout_cart_product_add_after>
</events>
</global>
</config>
app\code\local\Gta\FindPaymentGateway\Model\Observer.php
<?php
class Gta_FindPaymentGateway_Model_Observer
{
public function paymenter($Observer)
{
if(Mage::getSingleton('customer/session')->isLoggedIn())
{
// Get group Id
$groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
//Get customer Group name
$group = Mage::getModel('customer/group')->load($groupId);
Mage::log($group->getCode(),null,'filter.log',true);
}
}
}
?>
customer_group
then you filter that payment methods per customer_group, with this you can add more customers to this feature, maybe in the future. you can follow this magento.stackexchange.com/a/33055/48355