I’m trying to develop an Opencart4 Extension and for some reason it’s throwing a 404 when I try to access it.
I’ve the following structure:
/opencart/extensions/myextension/admin/controller/payment/myextension.php
/opencart/extensions/myextension/admin/template/payment/myextension.twig
and here’s the controller:
<?PHP
namespace OpencartAdminControllerExtensionMyExtensionPayment;
class MyExtension extends OpencartSystemEngineController {
public function index() {
$data = array();
$data['header'] = $this->load->controller('common/header');
$data['column_left'] = $this->load->controller('common/column_left');
$data['footer'] = $this->load->controller('common/footer');
$this->response->setOutput($this->load->view('extension/myextension/payment/myextension', $data));
}
}
Now when I try to access the http://localhost/admin123/index.php?route=extension/myextension/payment/myextension, I get a 404 page!
2
Answers
template must be twig file:
that works extension in opencart 4, before need compile your extension to
myextension.ocmod.zip
and then install from admin, then should works.
this is correct structure.