0
拡張クラスのオーバーライド機能をWC_Gateway_BACS
に追加しました。この機能は、注文のステータスを保留から処理に更新します。問題は電子メールに銀行の詳細が不足していることです。電子メールには銀行口座番号が含まれていますが、カスタマイズ後には電子メールには含まれていません。注文ステータスが処理中であるためです。Woocommerce BACSは電子メールの処理に銀行口座番号を追加します
ここに誰も同じことをして、解決策を思い付いていますか?私は保留中の画像と処理中の電子メールをいくつか含めました。私は実際に今日同じ問題に遭遇した
class WC_Gateway_BACS_custom extends WC_Gateway_BACS {
/**
* Process the payment and return the result
*
* @access public
* @param int $order_id
* @return array
*/
function process_payment($order_id) {
global $woocommerce;
$order = new WC_Order($order_id);
// Mark as processing (or anything you want)
$order->update_status('processing', __('Awaiting BACS payment', 'woocommerce'));
// Reduce stock levels
$order->reduce_order_stock();
// Remove cart
$woocommerce->cart->empty_cart();
// Return thankyou redirect
return array(
'result' => 'success',
'redirect' => $this->get_return_url($order)
);
}
/**
* Add content to the WC emails.
*
* @param WC_Order $order
* @param bool $sent_to_admin
* @param bool $plain_text
*/
// public function email_instructions($order, $sent_to_admin, $plain_text = false) {
// if (! $sent_to_admin && 'bacs' === $order->payment_method && ($order->has_status('on-hold') || $order->has_status('processing'))) {
// if ($this->instructions) {
// echo wpautop(wptexturize($this->instructions)) . PHP_EOL;
// }
// $this->bank_details($order->id);
// }
// }
}
on-hold email processing email