【发布时间】:2019-03-17 05:27:25
【问题描述】:
在 Woocommerce 中,我想从电子邮件通知中删除 Quantity 列,如下面的屏幕截图所示:
感谢任何帮助。
【问题讨论】:
标签: php wordpress templates woocommerce email-notifications
在 Woocommerce 中,我想从电子邮件通知中删除 Quantity 列,如下面的屏幕截图所示:
感谢任何帮助。
【问题讨论】:
标签: php wordpress templates woocommerce email-notifications
这可以做到Overriding the following WooCommerce Templates via a Theme。
相关模板为email/email-order-items.php和emails/email-order-details.php。
将此模板复制到yourtheme/woocommerce/emails/email-order-items.php 和yourtheme/woocommerce/emails/email-order-details.php 后,打开编辑它们:
1) 对于模板email/email-order-items.php:
更改第 78 行 <td colspan="3" 为 <td colspan="2"
删除以下代码块从第 66 行到第 68 行:
<td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
<?php echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $item->get_quantity(), $item ) ); ?>
2) 对于模板email/email-order-details.php:
更改第 70 行 <th class="td" scope="row" colspan="2" 到 <th class="td" scope="row"
更改第 79 行 <th class="td" scope="row" colspan="2" 为 <th class="td" scope="row"
删除第 45 行的代码块:
<th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?></th>
保存两个模板,你就完成了……你会得到类似的东西:
【讨论】: