php 根据支票付款将新收件人添加到管理新订单电子邮件。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 根据支票付款将新收件人添加到管理新订单电子邮件。相关的知识,希望对你有一定的参考价值。

/**
 * Add customer email recipient for admin New Order emails if a order placed with Checks
 *
 * @param string    $recipient a comma-separated string of email recipients (will turn into an array after this filter!)
 * @param \WC_Order $order     the order object for which the email is sent
 *
 * @return string $recipient the updated list of email recipients
 */
function hush_conditional_email_recipient( $recipient, $order ) {

	// Bail on WC settings pages
	$page = $_GET[ 'page' ] = isset( $_GET[ 'page' ] ) ? $_GET[ 'page' ] : '';
	if ( 'wc-settings' === $page ) {
		return $recipient;
	}

	// just in case
	if ( ! $order instanceof WC_Order ) {
		return $recipient;
	}

	//-- If paid with Cheque, change status to pending payment.
	if ( in_array( $order->get_payment_method(), array( 'cheque' ) ) ) {
		$recipient .= ', ' . $order->get_billing_email();

		return $recipient;
	}

	return $recipient;
}
//-- Add customer email recipient for admin New Order emails if a order placed with Checks
add_filter( 'woocommerce_email_recipient_new_order', 'hush_conditional_email_recipient', 10, 2 );

以上是关于php 根据支票付款将新收件人添加到管理新订单电子邮件。的主要内容,如果未能解决你的问题,请参考以下文章

将默认 WooCommerce 订单状态更改为处理支票和银行付款

贝宝电子支票需要一些解释

接受信用卡/电子支票付款

接收订单详情和付款确认(电子商务网站)[关闭]

如何将 WordPress 用户角色添加到 Woocommerce 新管理员订单电子邮件主题

收集和进行 ACH 付款