我正在 opencart 3 中编写自定义支付扩展。我已经设置了必要的方法并且插件未启用。我正在尝试在安装后自动启用该插件,但它确实可以工作。这些是我的代码。目录>上传/admin/controller/extension/mycustom.php
private $info_status = true;
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
$this->model_setting_setting->editSetting('gtpayment', $this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment', true));
}
if (isset($this->request->post['gtpayment_status'])) {
$data['gtpayment_status'] = $this->request->post['gtpayment_status'];
}else{
$data['gtpayment_status'] = $this->config->get('gtpayment_status');
}
如果这些代码不正确,是否有可能让插件在安装后自动启用。