i have created a shipping method extension in which shipping rate is correctly and even error message is also set when it conditions are sattisfied.
My question is when i am trying to set a the error message it is pulling the default message "Sorry, no quotes are available for this order at this time."
Below is my code
$result = Mage::getModel('shipping/rate_result');
$show = true;
if($show && $price > 0 && !$this->_error){
$method = Mage::getModel('shipping/rate_result_method');
$method->setCarrier($this->_code);
$method->setMethod($this->_code);
$method->setCarrierTitle($this->getConfigData('title'));
$method->setMethodTitle($methodName);
$method->setPrice($price);
$method->setCost($price);
$result->append($method);
}else{
$error = Mage::getModel('shipping/rate_result_error');
$error->setCarrier($this->_code);
$error->setCarrierTitle($this->getConfigData('name'));
if($this->_error){
$msg = "Shipping rate cannot be calculated.";
}else{
$msg = $this->getConfigData('specificerrmsg');
}
$error->setErrorMessage($msg);
$result->append($error);
}
return $result;