1

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

2
0

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);
    }
1
  • 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 '18 at 10:52

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.