I need to hide custom offline payment method according to customer Groups! how to achieve this ?


1 Answer 1


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.
    – Lasantha
    Feb 23, 2018 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.