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.
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/plugins/app.php');
class plgJ2StoreApp_Example extends J2StoreAppPlugin
{
/**
* @var $_element string Should always correspond with the plugin's filename,
* forcing it to be unique
*/
var $_element = 'app_example';```
This file should have following two methods:
**onJ2StoreGetAppView** - This method is used to check if it is a app_example or not.
viewList - A controller for this plugin.
```$html = $this->_getLayout('default', $vars);```
The above line will call the template layout for the app_example from /app_example/app_example/tmpl/default.php
**App Model Class**
App's model should have file named with appexample.php and it should be like below
defined(’_JEXEC’) or die(‘Restricted access’); require_once (JPATH_ADMINISTRATOR . ‘/components/com_j2store/library/appmodel.php’); class J2StoreModelAppExample extends J2StoreAppModel {
public $_element = 'app_example';
}
**App controller**
Controller.php file should be located in /app_donation/app_donation/controller.php and you must include the J2Store's library appcontroller and it should be written like below
defined(’_JEXEC’) or die(‘Restricted access’); require_once(JPATH_ADMINISTRATOR.’/components/com_j2store/library/appcontroller.php’);
class J2StoreControllerAppexample extends J2StoreAppController{