我需要以编程方式更改运费:
<?php
$percentage = 50;
$current_shipping_cost = WC()->cart->get_cart_shipping_total();
echo $current_shipping_cost * $percentage / 100;
?>
不幸的是,它不起作用,我总是得到0 (零)。
如何根据计算出的折扣百分比更改显示的总运费?
慕容708150
相关分类