2017-02-01 8 views
0

お客様の詳細のラベルを変更しましたが、「新規注文」メールのラベルは変更されません。これをどうやって変更できますか?ここで電子メールのウーココマースの顧客詳細ラベルを変更するにはどうすればよいですか?

は、注文が提出された後、私はそれが請求書のページに表示される方法を変更する方法である:

<header><h2><?php _e('Customer Details', 'woocommerce'); ?></h2></header> 

<table class="shop_table customer_details"> 
<?php if ($order->customer_note) : ?> 
    <tr> 
     <th><?php _e('Requested Dates:', 'woocommerce'); ?></th> 
     <td><?php echo wptexturize($order->customer_note); ?></td> 
    </tr> 
<?php endif; ?> 

これは、電子メールに何もしません。ここでは、電子メールにどのように表示されるかのスクリーンショットです:

I want this to cay "Requested Dates" instead of "Note"

私は、電子メール、顧客details.phpファイルにこのコードを見つけました:それは、この問題を理解するのに役立つかもしれない

<h2><?php _e('Customer details', 'woocommerce'); ?></h2> 
<ul> 
<?php foreach ($fields as $field) : ?> 
    <li><strong><?php echo wp_kses_post($field['label']); ?>: </strong> 
<span class="text"><?php echo wp_kses_post($field['value']); ?></span></li> 
<?php endforeach; ?> 
</ul> 

でる。

答えて

1

email-customer-details.phpテンプレートに渡された情報の配列であるwoocommerce_email_customer_details_fieldsをフィルタリングできます。

function so_41986388_email_customer_details_fields($fields, $sent_to_admin, $order){ 
    if(isset($fields['customer_note'])) { 
     $fields['customer_note']['label'] = __('Requested Dates:', 'your-text-domain'); 
    } 
    return $fields; 
} 
add_filter('woocommerce_email_customer_details_fields', 'so_41986388_email_customer_details_fields', 10, 3); 
関連する問題