問題描述
我正在使用 WordPress 4.8.1 并使用橋接主題.
我在從新訂單模板電子郵件中刪除價格方面遇到了一些問題.
我想刪除 price 列,但是我刪除了 total 和 subtotal ,但沒有得到任何東西來刪除帶有產品的 price 列作為通過文件.
我發現這是來自這個代碼:
$sent_to_admin,'show_image' =>錯誤的,'圖像大小' =>數組( 32, 32 ),'純文本' =>$plain_text,'sent_to_admin' =>$sent_to_admin,) );?>
在 email-order-details.php 模板中,我已將其從 woocommerce 模板文件夾復制到我的子主題中.
但是,如何自定義這個鉤子 'wc_get_email_order_items' 或任何其他方式來刪除價格?
這就是我現在所擁有的:
任何幫助將不勝感激,因為我花了很多時間尋找相同的解決方案.
這可以做到
I am using WordPress 4.8.1 and using bridge theme.
I am facing some problem regarding removing price from new order template email.
I want to remove price column ,however I removed total and subtotal , but not getting anything to remove price column with products as going through files.
I have found this is coming from this code:
<?php
echo wc_get_email_order_items( $order, array(
'show_sku' => $sent_to_admin,
'show_image' => false,
'image_size' => array( 32, 32 ),
'plain_text' => $plain_text,
'sent_to_admin' => $sent_to_admin,
) ); ?>
In email-order-details.php template which I have copied to my child theme from woocommerce template folder.
But , how to customise this hook 'wc_get_email_order_items' or any other way to remove price?
This is what I have now:
Any help will be appreciated as I have spent so much hours finding solution for same.
This can be done Overriding the following WooCommerce Templates via a Theme:
1.Template email/email-order-details.php
- Where you will remove the block at line 38:
<th class="td" scope="col" style="text-align:<?php echo $text_align; ?>;"><?php _e( 'Price', 'woocommerce' ); ?></th>
- And here also, all this blocks at line 50 to 63 (to remove):
<tfoot>
<?php
if ( $totals = $order->get_order_item_totals() ) {
$i = 0;
foreach ( $totals as $total ) {
$i++;
?><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
}
}
?>
</tfoot>
2.Template emails/email-order-items.php
.
- Where you will remove this block at line 59:
<td class="td" style="text-align:<?php echo $text_align; ?>; vertical-align:middle; border: 1px solid #eee; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;"><?php echo $order->get_formatted_line_subtotal( $item ); ?></td>
So you will get this:
這篇關于Woocommerce 電子郵件通知中的樣式訂單詳細信息表的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!