Hi guys,
I'm making a shipping module to suit my ever growing demands and I stuck for three days now on one thing, maybe anyone could give some advices.
The module is 7e flatrate mod. It has interface to add custom shipping rules to db, after that the enabled one for specific countries (thanks to shipping quotes) would be presented to customer but....
After pulling out those methods from db:
-------------
function uc_postman_shipping_method(){
$methods = array();
$enabled = variable_get('uc_quote_enabled', 0);
$result = db_query("SELECT * FROM {uc_postman} ORDER BY id");
while ($met = db_fetch_object($result)){
$methods['m'.$met->id] = array(
'id' => 'm'.$met->id,
'module' => 'uc_postman',
'title' => $met->name,
'enabled' => $enabled['m'.$met->id],
'quote' => array(
'type' => 'order',
'callback' => 'uc_postman_quote_order',
'accessorials' => array(
$met->name,
),
),
'weight' => $weight['m'.$met->id],
);}
return $methods;
}
------------------
I think I have to provide numerous callback functions (?) like:
-------------------
function uc_postman_quote_order($products, $details){
$result = db_query("SELECT * FROM {uc_postman} WHERE id = %d", 22);
$met = db_fetch_object($result);
$method = uc_postman_shipping_method();
$rate = $met->rate;
$quotes[] = array('rate' => $rate, 'format' => uc_currency_format($rate), 'option_label' => $method['s'.$met->id]['quote']['accessorials'][0]);
return $quotes;
}------------------
And the thing is, I don't know how on earth I can put that callback functions in some kind of loop (?) or other clever method so as module would base on pure code, without any static variables - like that '22' standing for id.
I would be very grateful for any help, if it's possible. I spent so mouch time on that that even drupal song doesn't help me anymore 

