如何修改结帐总额。添加了我的自定义费率,此费率在动态wordpress hook
上生成add_filter('woocommerce_package_rates','test_overwrite_fedex',100,2);
function test_overwrite_fedex($rates,$package) {
foreach ($rates as $rate) {
var_dump($rates);die();
//Set the price
$rate->cost = 1000;
//Set the TAX
$rate->taxes[1] = 1000 * 0.2;
}
return $rates;
}