1

I inherited a highly customized Magento-store. One of the modifications was to hide the free shipping method from one of the customer groups at checkout. I want to undo this modification, so all customer groups can see free shipping as per the default set up. The problem is, I can't seem to find where the modification has been made. I have checked in the template app/design/frontend... and in Shipping, app/code/core/Mage/Shipping . I didn't find any modifications in any files there that would cause this behavior.

Where would a modification to hide a shipping method from a user group on checkout have been made?

1
  • It wouldn't be in Magento's core files. I would start by looking at the names of the various modules located in app/code/local and app/code/community and see if a descriptive module name could at least get you on the right track. Once you determine the module that might possibly be the one, look inside of the config.xml at all of the observers. There may be one also named descriptively. May 2 '18 at 4:32
1

You can do that by overwrite your free shipping carrier file app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php

Mage_Shipping_Model_Carrier_Freeshipping

You will need to check in collectRates function that your logged in customer is from your specific customer group or not.

You can add below code just after

if (!$this->getConfigFlag('active')) {
    return false;
}

if (Mage::getSingleton('customer/session')->isLoggedIn()) {
    $customer = Mage::getSingleton('customer/session')->getCustomer();
    if ($customer->getGroupId() == 1) { // this is for general customer group, you can add your specific customer group for which you want to restrict free shipping method.
        return false;
    }
}

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.