想要发送新订单电子邮件警报到不同的地址时,有人结帐,并已选中“发货到不同的地址?”。
这个是可能的吗?
发布于 2020-01-17 05:54:59
是。在你的主题文件夹(如果你使用子主题)或插件文件中的functions.php中添加一个钩子。
add_action('woocommerce_thankyou', 'email_admin_about_shipping', 10, 1);
function email_admin_about_shipping( $order_id ) {
if(isset($_POST['ship_to_different_address'])){
$to = get_option('admin_email');
wp_mail($to, $subject, strip_tags($message), $headers);
}
}添加你的主题,消息等,这对你来说应该是有效的。
https://stackoverflow.com/questions/59777959
复制相似问题