document say Each line item is an associative array containing the tax's id, name, amount, and weight. but it not work. I look at this code
function uc_line_item_tax($op, $order) {
switch ($op) {
case 'load':
$lines = array();
$taxes = uc_taxes_calculate($order);
foreach ($taxes as $tax) {
$lines[] = array(
'id' => 'tax',
'title' => $tax->name,
'amount' => $tax->amount,
'weight' => variable_get('uc_li_tax_weight', 9) + $tax->weight / 10,
'data' => $tax->data,
);
}
return $lines;
}
}so my_calculate_tax return a object . it is work.
Comments
Comment #1
mengweifu1985 commentedHello ! Is anybody there ?
Comment #2
Island Usurper commentedEventually. Sometimes I work on other things.
For the record, that page was correct for Ubercart 1.x, when it was first written.
Comment #3
mengweifu1985 commentedthanks for help.
Comment #4
Island Usurper commentedThis is listed on the page describing what's changed between Ubercart 1.x and 2.x (http://www.ubercart.org/docs/developer/6866/converting_modules_ubercart_...), and the documentation on api.ubercart.org should be up to date soon. I'm starting to think that the API section on ubercart.org isn't really sustainable as it is.