static function estimateShipping($order) { $c = new shippingcalculator(); $calc = $c->find('first', "enabled=1 AND is_default=1"); $calcName = $calc->calculator_name; $calculator = new $calcName(); if ($calculator->addressRequired()) { return 0; } else { $rates = $calculator->getRates($order); return $rates['01']['cost']; } }