You are here

从Ubercart 1.3到1.4的API变动

Index of changes:

变动索引:

1.       hook_calculate_tax() was added

2.       添加了hook_calculate_tax()

hook_calculate_tax() was added

添加了hook_calculate_tax()

This hook allows Ubercart to use multiple tax calculation schemes on its orders. The only argument is the entire order object for which the taxes will be calculated.

这个钩子让Ubercart可以对它的订单使用多个税收计算方案。这里面仅有的一个参数就是,所要计算的订单对象/

The hook implementations should return an array of tax line items, which are arrays with the following keys:

钩子函数应该返回一个数组,里面包含了税收行项(line items),里面用到以下键:

·                                 id

·                                 name

·                                 amount

·                                 weight (optional)

Make sure that your module's tax ids are properly namespaced to prevent collisions with other taxes.

确保你模块的税收ids使用了合适的命名空间,以避免与其它的税收冲突。

相关链接: Think in Drupal

http://www.ubercart.org/docs/developer/6867/api_changes_ubercart_13_14

Drupal版本: