79754067

Date: 2025-09-03 02:04:59
Score: 0.5
Natty:
Report link

problem fixed using event logic
Instead of modifying account/account.php,I intercept the route before it’s executed, using OpenCart’s startup event system.

<?php
class ControllerStartupAgent extends Controller {
    public function index() {
        if (isset($this->request->get['route']) && $this->request->get['route'] == 'account/account') {
            if ($this->config->get('module_agent_status')) {
                $this->response->redirect($this->url->link('account/agent', '', true));
            }
        }
    }
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: musab