2017-02-22 36 views

回答

1

按照這個答案,我得到了解決 https://stackoverflow.com/a/24190390/5194017

同在這個答案我重寫BACS網關的文件並覆蓋此功能

public function thankyou_page($order_id) { 
    if ($this->instructions) { 
       echo wpautop(wptexturize(wp_kses_post(str_replace("{order_number}", $order_id, $this->instructions)))); 
      } 
      $this->bank_details($order_id); 

} 
public function email_instructions($order, $sent_to_admin, $plain_text = false) { 

    if (! $sent_to_admin && 'bacs' === $order->payment_method && $order->has_status('on-hold')) { 
     if ($this->instructions) { 
      echo wpautop(wptexturize(str_replace("{order_number}", $order->id, $this->instructions))) . PHP_EOL; 
     } 
     $this->bank_details($order->id); 
    } 

} 

添加「{ORDER_NUMBER}」在BACS指令字段您要在哪裏顯示訂單號並用$ order_id替換{order_number}。