Giter Site home page Giter Site logo

lequangios / oc_extension_generator Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 1.0 389 KB

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

PHP 41.78% Twig 58.22%
opencart opencart-4x opencart-extension php extension

oc_extension_generator's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.