lequangios / oc_extension_generator

This tool supports fixing some errors related to the namespace of extensions downloaded from OpenCart Extension Store that make them impossible to install and use.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

opencart extension generator

Opencart logo

OC extension generator is a tool to help admins and developers create, install and remove extensions for Opencart. This tool will create a file and set up some basic sourcecode for an Opencart extension

This tool supports fixing some errors related to the namespace of extensions downloaded from OpenCart Extension Store that make them impossible to install and use.

  • PHP : 8+
  • Opencart : 4.x.x

User manual

Install

- clone the whole source from git to your machine

- copy and merge the admin, system folder with your admin folder

Using

- Access the following route :

https://your_admin_url/index.php?route=tool/extension

- List installer extensions, currently only one installer is the default installer of opencart. It means that the entire sourcecode of the extension will be located in the directory your_project_dir/extension/opencart

OC extension generator list

- Click the view button to go to the detail page. Here we will see a list of extensions found in the system. You can use the filter by type to find your extension

OC extension generator detail

- Click on the view button on each extension and you will see detailed information about the files related to that extension.

OC extension detail

Install new extension

- Download new extension from OpenCart Extension Store and copy and merge the admin, system folder with your extension/opencar folder. Example I download the Trackfree extension.

- Visit the detail page, you will see Trackfree in the list and click

OC extension list

- After install , you can click setting button and go to setting page of plugin.

OC extension list

Uninstall an extension

- Click uninstall to extension

Remove an extension

Click the remove button to remove the extension, this will uninstall and delete the files related to the extension.

Remove an extension

- Visit the detail page, you will see add button at bottom.

OC extension new

- After clicking the save button, the system will automatically generate the files and basic sourcecode required of an extension and you can see the path to those files by clicking the view button.

- Part of the sourcecode is automatically generated :

namespace Opencart\Admin\Controller\Extension\Opencart\Other;
class MyExtension extends \Opencart\System\Engine\Controller {
	public function index(): void {
		$this->load->language('extension/opencart/other/my_extension');
		$this->document->setTitle($this->language->get('heading_title'));
		$this->load->model('extension/opencart/other/my_extension');
		$data['breadcrumbs'] = [];
		$data['breadcrumbs'][] = [
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
		];
		$data['breadcrumbs'][] = [
			'text' => $this->language->get('heading_title'),
			'href' => $this->url->link('extension/opencart/other/my_extension', 'user_token=' . $this->session->data['user_token'])
		];
		$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/opencart/other/my_extension', $data));
	}

	public function install(): void {}
	public function uninstall(): void {}
}

License

- OC extension generator is released under the MIT license. See LICENSE for details.

- OC extension generator is useful for you? Please consider donating to sustain our activities ? Please consider donating to sustain my activities.

About

This tool supports fixing some errors related to the namespace of extensions downloaded from OpenCart Extension Store that make them impossible to install and use.

License:MIT License


Languages

Language:Twig 58.2%Language:PHP 41.8%