【发布时间】:2018-05-15 16:33:54
【问题描述】:
【问题讨论】:
-
您查看过模板文件吗?常识决定了你会拥有。
-
我查看了模板文件@ProEvilz。事实上,我已经使用模板做了很多更改,但没有找到在表格中隐藏运输标签的解决方案。
标签: php wordpress woocommerce shipping email-notifications
【问题讨论】:
标签: php wordpress woocommerce shipping email-notifications
Overriding woocommerce templates via the theme,删除电子邮件通知中的运输行可以很容易地向emails/email-order-details.php 模板添加一些代码。
这是从 line 51 开始的摘录。因此,您将使用以下代码替换所有代码 beetwen html 打开<tfoot> 标签和关闭</tfoot> 标签:
<tfoot>
<?php
if ( $totals = $order->get_order_item_totals() ) {
$i = 0;
foreach ( $totals as $key_total => $total ) {
$i++;
if( $key_total != 'shipping' ):
?><tr>
<th class="td" scope="row" colspan="2" style="text-align:<?php echo $text_align; ?>; <?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"><?php echo $total['label']; ?></th>
<td class="td" style="text-align:<?php echo $text_align; ?>; <?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"><?php echo $total['value']; ?></td>
</tr><?php
endif;
}
}
if ( $order->get_customer_note() ) {
?><tr>
<th class="td" scope="row" colspan="2" style="text-align:<?php echo $text_align; ?>;"><?php _e( 'Note:', 'woocommerce' ); ?></th>
<td class="td" style="text-align:<?php echo $text_align; ?>;"><?php echo wptexturize( $order->get_customer_note() ); ?></td>
</tr><?php
}
?>
</tfoot>
这是经过测试并且有效的。所以你会得到类似(没有发货行):
【讨论】: