2017-06-12 114 views

回答

0

這裏是woocommerce_email_recipient_cancelled_order過濾鉤子自定義掛鉤函數:

add_filter('woocommerce_email_recipient_cancelled_order', 'adding_customer_email_recipient_to_cancelled', 10, 2); 
function adding_customer_email_recipient_to_cancelled($recipient, $order){ 
    $billing_email = $order->get_billing_email(); 
    $recipient .= ', ' . $billing_email; 
} 

代碼放在您的活動子主題(或主題)的function.php文件或者也在任何插件文件中。

此代碼已經過測試,適用於WooCommerce 3.0+

0

您可以使用動作鉤子woocommerce_order_status_cancelled,當訂單狀態更改爲取消執行此操作。

在例如:

add_action('woocommerce_order_status_cancelled', function($order_id){ 
    //send email here 
}, 10, 1); 
相關問題