I need to hide custom offline payment method according to customer Groups! how to achieve this ?
1 Answer
We have to add this code in our Namespace/Modulename/Model/ in file.php
public function isActive($storeId = null)
{
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
$customerGroupId = $customerSession->getCustomerGroupId();
if ($customerGroupId != 4) {
return false;
}
return (bool)(int)$this->getConfigData('active', $storeId);
}
-
can you explain this for bank transfer method I want to show only specific customer to bank transfer method. can you post the steps.– LasanthaCommented Feb 23, 2018 at 10:52