in /catalog/controller/startup/api.php - i changed the code:
but I have no success
404 - GET: https://mydomain/index.php?route=api/sy ... 8f5909dacc
Code: Select all
public function index(): object|null {
$action = null;
// Проверка за зададен маршрут
if (isset($this->request->get['route'])) {
$route = (string)$this->request->get['route'];
// Проверка за конкретния API маршрут
if ($route == 'api/sync/getAllProducts') {
$action = new \Opencart\System\Engine\Action('api/sync/getAllProducts');
} elseif ($route == 'api/sync/importProduct') {
$action = new \Opencart\System\Engine\Action('api/sync/importProduct');
} elseif ($route == 'api/sync/editProduct') {
$action = new \Opencart\System\Engine\Action('api/sync/editProduct');
} elseif ($route == 'api/sync/deleteProduct') {
$action = new \Opencart\System\Engine\Action('api/sync/deleteProduct');
}
}
// Проверка за валиден API токен
if (substr($route, 0, 4) == 'api/' && $route !== 'api/account/login' && !isset($this->session->data['api_id'])) {
return new \Opencart\System\Engine\Action('error/permission');
}
return $action;
}
404 - GET: https://mydomain/index.php?route=api/sy ... 8f5909dacc
Who is online
Users browsing this forum: No registered users and 2 guests