1
電子メールを注文するカスタム注文メタを保存していますが、カスタムテンプレートでそれらのスタイルを設定する必要もあります。私がpタグにクラスを与えて、注文メタがラップされていても、クラスの配列がそのトリックをやっていないのが最も簡単です。WooCommerceの電子メール通知でカスタムメタデータにクラスを追加
function salesman_email_order_meta_fields($fields, $sent_to_admin, $order) {
$user_id = get_current_user_id();
$key = 'billing_salesman';
$single = true;
$current_user_has_discount = get_user_meta($user_id, $key, $single);
if(! empty($current_user_has_discount)){
$fields['_billing_salesman'] = array(
'label' => __('Sales Representative'),
'value' => $current_user_has_discount,
'class' => array('salesRep'),
);
}
$is_po = get_post_meta($order->id, '_other_payment-admin-note', true);
if(! empty($is_po)){
$fields['_other_payment-admin-note'] = array(
'label' => __('PO Number'),
'value' => $is_po,
'class' => array('poNum'),
);
}
return $fields;
}
add_filter('woocommerce_email_order_meta_fields', 'salesman_email_order_meta_fields', 11, 3);
は、どのように私はカスタムオーダー電子メールのメタフィールドにクラスを追加、および/または電子メールテンプレートにそれらのスタイルを設定することができます?私が試した何
魔法のように動作しますが、再び一日を保存するためにありがとう! –