Question

By $result = Mage::getModel('shipping/rate_result'); method I can create a new shipping rate. but How I can restrict other shipping methods in this acction?

Was it helpful?

Solution

Grab All active shipping methods, loop through each one, and see if it matches your desired one

$activeCarriers = Mage::getModel('shipping/config')->getActiveCarriers();
foreach($activeCarriers as $code => $method) {
    if($code == 'yourcode') {
         $result = Mage::getModel('shipping/rate_result');
    }

}   
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top