WooCommerce では、days_manufacture
製品ごとに異なる (整数) 値を持つカスタム フィールドがあります。
また、 「製造日数」の値が最も高いカートページにメッセージを表示するこのコードがあります。
add_action('woocommerce_before_cart', 'days_of_manufacture');
function days_of_manufacture() {
$day_txt = ' ' . __('day', 'your_theme_domain_slug' );
$days_txt = ' ' . __('days', 'your_theme_domain_slug' );
$text = __('Your Order will be produced in: ', 'your_theme_domain_slug' );
$max_days = 0;
foreach( WC()->cart->get_cart() as $cart_item )
if($cart_item['days_manufacture'] > $max_days)
$max_days = $cart_item['days_manufacture'];
if($max_days != 0) {
if ($max_days == 1)
$days_txt = $day_txt;
$output = $text . $max_days . $days_txt;
echo "<div class='woocommerce-info'>$output</div>";
}
}
今、私はこのメッセージを電子メールに表示したいと思います。
どうすればこれを達成できますか?
ありがとう