函数hook_shipping_type()位于uc_quote.module模块中:
<?php
hook_shipping_type()
?>
描述:
这个钩子该模块所要处理的运送类型。这些类型分别有一个内部名字'id',和一个外部名字'title'。对于单独的产品,制造商,以及整个网店目录,都可以为其设置运送类型。运送模块应该在使用运送类型ids的时候,要小心,因为其它的类似模块也可能使用相同的名字(比如,FedEx 和UPS都有“小包裹”运送类型)。对于那些与运送无关的模块,则不需要实现这个钩子。
返回值:
一个数组,里面包含了运送类型,键为运送类型的内部名字
示例:
<?php
function uc_ups_shipping_type(){
$weight = variable_get('uc_quote_type_weight', array('small_package' => 0));
$types = array();
$types['small_package'] = array(
'id' => 'small_package',
'title' => t('Small Packages'),
'weight' => $weight['small_package'],
);
return $types;
}
?>