CS,
You are correct in your assumption that that is where the message is generated, but that is actually the inverse of your request. What you should be looking for, is where invalid shipping is hidden, so that you can add your required criteria to the list?
Further up the file you will find this code -
// inspired by Jim Barrington (JollyJim)
if (isset($order) && @constant('MODULE_SHIPPING_' . $module . '_HIDE_SHIPPING_ERRORS') == 'True' ){
switch (isset($order->info['subtotal'])){
case true:
if ($order->info['subtotal'] < @constant('MODULE_SHIPPING_' . $module . '_MIN_ORDERVALUE')){
$this->enabled = false;
return ;
} elseif (@constant('MODULE_SHIPPING_' . $module . '_MAX_ORDERVALUE') != -1 && $order->info['subtotal'] > @constant('MODULE_SHIPPING_' . $module . '_MAX_ORDERVALUE')){
$this->enabled = false;
return ;
}
break;
case false:
if ($order->info['total'] < @constant('MODULE_SHIPPING_' . $module . '_MIN_ORDERVALUE')){
$this->enabled = false;
return ;
} elseif (@constant('MODULE_SHIPPING_' . $module . '_MAX_ORDERVALUE') != -1 && $order->info['total'] > @constant('MODULE_SHIPPING_' . $module . '_MAX_ORDERVALUE')){
$this->enabled = false;
return ;
}
break;
} // end of switch on subtotal
// check that it is a valid country being shipped to.
$dest_country = $order->delivery['country']['iso_code_2'];
$dest_zone = 0;
for ($i=1; $i<=$this->num_zones; $i++) {
$countries_table = constant('MODULE_SHIPPING_' . $module . '_ZONES_COUNTRIES_' . $i);
$country_zones = preg_split("/,/", preg_replace('/\s*/','',$countries_table) );
if (in_array($dest_country, $country_zones)) {
$dest_zone = $i;
break;
}
}
// ship to country is invalid for this service
if ($dest_zone == 0) {
$this->enabled = false;
return ;
} else {
$this->enabled = false; // enabled set to true if valid shipping weight found
$zones_cost = constant('MODULE_SHIPPING_' . $module . '_ZONES_COST0_' . $dest_zone);
$zones_table = preg_split("/[:,]/" , preg_replace('/\s*/','',$zones_cost) );
$size = sizeof($zones_table);
for ($i=0; $i<$size; $i+=2) {
if ($total_weight <= $zones_table[$i]) {
$this->enabled = true;
break;
}
} // end of looping through
return ;
} // end of valid country
} // end of if hide invalid shipping methods is set
which is actually in the initialisation/constructor section, and which checks the subtotal against Min order value, Max order value, and destination country. It does NOT check for a 'valid' weight.
You would need to add a weight check there if you wished to. I'd note that this is possibly NOT trivial, as there does not appear to be a MAX_WEIGHT constant defined, so you would either have to define one, or extract it from the shipping price/weight tables.
Hope that helps a bit.
Rgds,
Chuck