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

mengweifu1985’s picture

Hello ! Is anybody there ?

Island Usurper’s picture

Priority: Critical » Normal

Eventually. Sometimes I work on other things.

For the record, that page was correct for Ubercart 1.x, when it was first written.

mengweifu1985’s picture

thanks for help.

Island Usurper’s picture

Status: Needs review » Fixed

This 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.