私はopencartのカスタム支払い方法に取り組んでいます。私が必要とするのは、管理者から管理者に変更された注文履歴の変更を聞くことです。それは大丈夫でしたが、私が何をしていても、opencartのイベントトリガを働かせることができませんでした。ここでOpenCart addOrderHistoryイベントが動作しません
は、それが今のように見えるものです:
public function install() {
$this->load->model('extension/event');
$this->model_extension_event->addEvent('delayed_payment_oh_add', 'catalog/model/checkout/order/addOrderHistory/after', 'admin/controller/extension/payment/delayed_payment/send_instructions');
$this->model_extension_event->addEvent('delayed_payment_oh_api', 'catalog/controller/api/order/history/after', 'admin/controller/extension/payment/delayed_payment/send_instructions');
}
public function uninstall() {
$this->load->model('extension/event');
$this->model_extension_event->deleteEvent('delayed_payment_oh_add');
$this->model_extension_event->deleteEvent('delayed_payment_oh_api');
}
そして、リスナー自身:
public function send_instructions($route, $output, $order_id, $order_status_id) {
$this->load->model('checkout/order');
$this->log->write(var_dump($output));
echo var_dump($output);
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_status_id == $this->config->get('delayed_payment_confirmed_order_status'))
$this->model_checkout_order->addOrderHistory(
$order_id,
$this->config->get('delayed_payment_waiting_order_status'),
$this->config->get('delayed_payment_order_comment'),
true
);
}
それは、ログまたは出力の両方には何も印刷されていません。 どのように動作させることができますか? (Opencart 2.3)
send_instructions関数を含むファイルはどこですか?どのディレクトリに? – DigitCart
@Mojtaba私はadmin(admin/controller/extension/payment/delayed_payment.php)とカタログコントローラ(catalog/controller/extension/payment/delayed_payment.php)の両方で、 –