![](/img/trans.png)
[英]WooCommerce - How can I stop the New Order email being sent to admin recipient if a certain shipping method is used?
[英]Replace New order email recipient programmatically In Woocommerce
我正在嘗試使用以下代碼根據網站語言更改管理員電子郵件:
if ( !function_exists('my_email_heading_customisation_function_ent') ) {
function my_email_heading_customisation_function_ent( $recipient, $order )
{
global $woocommerce;
$page = $_GET['page'] = isset( $_GET['page'] ) ? $_GET['page'] : '';
if ( 'wc-settings' === $page ) {
return $recipient;
}
// just in case
if ( ! $order instanceof WC_Order ) {
return $recipient;
}
$recipient = "some@email.cz";
return $recipient;
}
add_filter('woocommerce_email_recipient_new_order', 'my_email_heading_customisation_function_ent', 10, 2);
}
但這是行不通的。
任何想法如何解決這個問題?
線程很多,有些確實太舊了。 我已經檢查了文檔,沒有提及與此鈎子相關的任何更改。 我一直在為此扯頭發。
好的,謝謝您的幫助。 原來,該過濾器正在運行,問題是由HYYAN Woocommerce Polylang集成引起的。 我要和插件作者一起解決...
Josif
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.