php - Customize orders details table in Woocommerce email notifications -


i using wordpress 4.8.1 , using bridge theme.
facing problem regarding removing price new order template email.
want remove price column ,however removed total , subtotal , not getting remove price column products going through files.

i have found coming 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 have copied child theme woocommerce template folder.

but , how customise hook 'wc_get_email_order_items' or other way remove price?

this have now:

enter image description here

any appreciated have spent hours finding solution same.

this can done overriding following woocommerce templates via theme:

1.template orders/email-order-details.php

  • where remove block @ line 38:
<th class="td" scope="col" style="text-align:<?php echo $text_align; ?>;"><?php _e( 'price', 'woocommerce' ); ?></th> 
  • and here also, blocks @ line 50 63 (to remove):
<tfoot>     <?php         if ( $totals = $order->get_order_item_totals() ) {             $i = 0;             foreach ( $totals $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 remove block @ 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 this:

enter image description here


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -