我已尝试取消设置代码但随后它也会删除总计。我想留下总数并删除运费总额。
<?php
if ( $totals = $order->get_order_item_totals() ) {
$i = 0;
foreach ( $totals as $total ) {
$i++;
?><tr>
<th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
}
}
?>
我似乎无法为此找到解决方案。有什么建议吗?
感谢。
答案 0 :(得分:2)
要删除送货小计专栏,请尝试使用以下代码:
stlf
或者你可以使用 res2 <- stlf(ts(c(100, 110, 120, 200, 300, 100, 200, 100, 120, 300), start = c(2009, 1), frequency = 4))
acc <- accuracy(res2)
acc[,"MAPE"]
php函数:
<?php
if ( $totals = $order->get_order_item_totals() ) {
$i = 0;
foreach ( $totals as $total_key => $total ) { // Changed HERE
$i++;
if( 'shipping' != $total_key ){ // Added HERE
?><tr>
<th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
} // Added HERE
}
}
?>