I have try to do remove pay online & cash on delivery option if we sign in for wholesale Magento



You can follow this blog to disable payment method based on the condition

you can set your custom logic by using this code

in the Observer.php file please replace this code to satisfy your condtion


class Vendor_Extension_Model_Observer {

    public function paymentMethodIsActive(Varien_Event_Observer $observer) {
        $method = $observer->getMethodInstance();
        if ($method->getCode() == 'cashondelivery') {


                $groupeId = Mage::getSingleton('customer/session')->getCustomerGroupId();
                if ($groupeId==2) {
                    $result = $observer->getResult();
                    $result->isAvailable = false;

  • We logged in as a wholesaler. then hide cash on delivery..
    – Vipin
    Aug 16 '19 at 4:23
  • what is the groupe id of wholesaler customer groupe Aug 16 '19 at 5:48
  • ill update my code please check this Aug 16 '19 at 5:54

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.