2015-06-09 27 views

回答

0

首先,如果您還沒有這樣做,請將您的woocommerce模板文件複製到主題根,如http://docs.woothemes.com/document/template-structure/中所述。 然後,打開一個負責構建電子郵件模板的文件。在我的情況下,它是(複製過來後)/wp-content/themes/MY_THEME/woocommerce/emails/admin-new-order.php 找到下面的代碼行

<tfoot> 
    <?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 
      } 
     } 
    ?> 
</tfoot> 

,並添加檢查條件,如果一個標籤包含了付款方式,像這樣

<tfoot> 
    <?php 
     if ($totals = $order->get_order_item_totals()) { 
      $i = 0; 
      foreach ($totals as $total) { 
       $i++; 
       if ($total['label'] != 'Payment Method:'){ 
        ?><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 
       } 
      } 
     } 
    ?> 
</tfoot> 

您可以使用此對等領域也

相關問題