如何在wordpress中修改结帐总额

时间:2018-02-09 07:38:32

标签: wordpress

如何修改结帐总额。添加了我的自定义费率,此费率在动态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;
}

0 个答案:

没有答案