Plugin structure

All plugins need to be organised in a specific structure.

Make sure that you use these folder names for your plugin to avoid unpredicted behaviour!
PluginDirectory/
    ├── meta/
    │   ├── images/
    │   │   │   // preview images showing this plugin
    │   │   ├── preview_[0-6].[png │ jpeg]
    │   │   │   // plugin icons
    │   │   ├── icon_plugin_[xs │ sm │ md].[png │ jpeg]
    │   │   │   // authors logo
    │   │   └── icon_author_[xs │ sm │ md].[png │ jpeg]
    │   └── documents/
    │       └── user_guide_[en │ de │ etc].md // user guide for the plugin
    │
    ├── resources/
    │   ├── css/
    │   │   └── // .css and .scss files
    │   ├── images/
    │   │   └── // images
    │   ├── js/
    │   │   └── // JavaScript and CoffeeScript
    │   ├── lang/
    │   │   └── // language files
    │   ├── documents/
    │   │   └── // fonts, pdf-files or other resources
    │   └── views/
    │       └── // twig templates (can be organised in sub-folders)
    │
    ├── src/
    │   └── // plugin source code
    │
    ├── tests/
    │   └── // tests will be executed before build
    │
    ├── ui/
    │   └── // files for back end views
    │
    ├── config.json // admin's plugin options
    ├── plugin.json // plugin information
    ├── ui.json // back end menu information
    ├── README.md
    └── CHANGELOG.md // change log for the plugin

For detailed information about the different plugin features, refer to the Template plugin guide or Payment plugin guide.

For detailed information on writing tests, refer to the PHPUnit documentation. To compose a test suite for a plugin, use the tests/ folder. When uploading a plugin to a Git repository, the test folder will be included, making your quality assurance process more transparent.

Plugin details

All information about your plugin is defined in a plugin.json file. This file defines the service provider of your plugin, which will be called by plentymarkets to register and run your plugin. For more information, see this page.

Plugin configuration

You can define multiple options that will be displayed in the Plugins » Plugin overview menu to be configured by users. The value of each option can be accessed in your PHP code by using the ConfigRepository or from Twig templates by using the config() macro. For more information about the plugin configuration, see this page.

Multilingualism

You can enter translations for the configuration file both with the old and the new structure. The properties label, caption and tooltip of an entry can be translated. Note: Every translation key must feature the prefix Config.. For more information about multilingualism, see this page.

Back end menu information

All information about the back end menu entries is saved in a ui.json file. This file defines the entry points for the plugin. Views are then available at the respective menus. For more information about back end menu entries, see this page.

Plugin deployment

After creating a plugin with the respective structure and files, the plugin needs to be added to your system and deployed. There are two ways to accomplish this:

If you use plentyDrive and activated the automatic build function in your back end, plugin sets will be deployed automatically after each sync. If you use Git webhooks, you must deploy plugin sets manually before changes become visible. To do this, in your back end, go to the Plugins » Plugin overview menu and, in the plugin sets containing your developed plugin, click the Save & publish plugins button.

  • Clicking on the Save & publish plugins icon will start the deployment process for all plugins that have a check mark in the Active column of the plugin set.
    → You can not start the deployment process for individual plugins.

You need to deploy the plugins if one of the following has occurred since the last deployment process:

  • new plugins were added and activated
  • plugins were updated
  • plugins were activated
  • plugins were deactivated
  • deployment errors were fixed
  • currently deployed plugins were deleted

Is this article helpful?

 

Thank you for your Feedback

you can close this field now!