App for J2store
J2Commerce (formerly known as J2Store)
In the following guide, we are going to cover the following topics related to plugin development:
Introduction App Structure Naming Conventions The Manifest Creating app class App Model Class App controller
Introduction
Developing a app for J2Store is very simple process if you are good in PHP and the Joomla MVC structure.
J2Store comes with a app library and wrappers that makes creating a app for J2Store.
App Structure
There is a folder structure and a few naming conventions, that should be followed during the development of a app for J2Store.
A typical app should look like this:
├── app_example/
│ ├── app_example.php
│ ├── app_example.xml
│ ├── languages/
│ │ ├── en-GB.plg_j2store_app_example.ini
│ ├── app_example/
│ │ ├── tmpl/
│ │ │ ├── form.php
│ │ │ ├── default.php
│ │ ├── controller.php
│ │ ├── models/
│ │ │ ├── appexample.phpNaming Conventions
The name of the app folder should start with the prefix “app_”. Otherwise, J2Store will not recognise your app. So our example app is named as:app_example
Make sure that the name of the file and folder is in lower case and there are no spaces or any other characters in the name.
Manifest
An example manifest should look like this:
Creating app class
Make sure the name of the class suffix is same as your app file’s name. And it should extend the J2StoreAppPlugin class.
defined(’_JEXEC’) or die(‘Restricted access’); require_once (JPATH_ADMINISTRATOR . ‘/components/com_j2store/library/appmodel.php’); class J2StoreModelAppExample extends J2StoreAppModel {
}
defined(’_JEXEC’) or die(‘Restricted access’); require_once(JPATH_ADMINISTRATOR.’/components/com_j2store/library/appcontroller.php’);
class J2StoreControllerAppexample extends J2StoreAppController{
}
Last updated