2017-05-01 4 views
0

에서 특정 요소를 제거?WooCommerce - 나는 <strong>woocommerce_email_order_details</strong>에서 <strong>첫 번째 행에만</strong> (제품명, 수량 및 가격)를 제거하려면 어떻게 woocommerce_email_order_details

This is how email looks right now

현재 admin_new_order.php 다음 코드를 당신이 그림에서 볼 수있는 모든 요소를 ​​생성하는 기능입니다

<?php  

if (! defined('ABSPATH')) { 
    exit; 
} 


do_action('woocommerce_email_header', $email_heading, $email); ?> 

<p><?php printf(__('You have received an order from %s. The order is as follows:', 'woocommerce'), $order->get_formatted_billing_full_name()); ?></p> 

<?php 


do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email); 


do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email); 


do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email); 


do_action('woocommerce_email_footer', $email); 

woocommerce_email_order_details가 포함되어 있습니다. 다른 함수가이 함수를 사용하고 있기 때문에 전체 함수를 제거하지 말아야한다는 것을 알고 있습니다. 그렇다면 첫 번째 행에만 액세스하여 제거 할 수 있습니까?

답변

0

function so_39251827_remove_order_details($order, $sent_to_admin, $plain_text, $email){ 
    $mailer = WC()->mailer(); // get the instance of the WC_Emails class 
    remove_action('woocommerce_email_order_details', array($mailer, 'order_details'), 10, 4); 
} 
add_action('woocommerce_email_order_details', 'so_39251827_remove_order_details', 5, 4); 
+0

나는 또한 발견하려고 여기에 솔루션 [링크] (http://stackoverflow.com/questions/39251827/delete-order-info-section-from-email-template-in- woocommerce? noredirect = 1 & lq = 1). 그러나 전체 섹션을 제거합니다. 앞서 언급했듯이 첫 번째 행만 제거하려고합니다. – Levy