Skip to main content

Plugin generator

Choose a plugin type, type a name and your details, and download a ZIP that Joomla's installer accepts. The form runs in your browser. Nothing you type is sent anywhere.

Group alfa-payments. Made from the example offline.
Shown in Joomla's plugin list.
Lower case letters and digits. It names the folder, the files, the class and the language keys.
The first part of the PHP namespace.
Shown under the name in Joomla's plugin list.

What the example code does. Records one pending payment when an order is placed. Staff press "Mark as paid" on the order, and the order moves to the status named in the method's settings.

What it is not. It is not connected to any payment provider. No money is requested, captured or refunded anywhere. It is a starting point, not a finished integration.

  • Give the plugin a name.
  • The element must be 2 to 40 lower case letters or digits and start with a letter.
  • The vendor must be 2 to 40 letters or digits and start with a capital letter. It becomes the first part of the PHP namespace.

What you get​

The generator writes no code of its own. Each plugin type has one complete example in this manual, and each example was installed and used on an Alfa Commerce 2.2.0 test shop. The generator takes that example and changes only names and details:

What changesFor example
The element, and with it the folder and file namesoffline.xml becomes mygateway.xml
The class nameOffline becomes Mygateway
The vendor part of the namespaceAcme\Plugin\AlfaPayments\Offline becomes YourVendor\Plugin\AlfaPayments\Mygateway
The language keysPLG_ALFA_PAYMENTS_OFFLINE_... becomes PLG_ALFA_PAYMENTS_MYGATEWAY_...
The manifestName, author, e-mail, URL, copyright, licence, version, description, date

Two things are added: a comment at the top of the plugin's class and a README.md. Both say what the example code does, what it is not, and what is yours to write, with the manual pages to read.

Everything else is the example, line for line. So the plugin you download works at once: install it, enable it, and it does what its example does.

Plugin typeThe example it is made fromWhat it does when installed
Payment pluginA complete payment pluginRecords a pending payment at checkout; staff press "Mark as paid"
Shipping pluginA complete shipping pluginCharges the price typed on the method and records a parcel
Item field pluginA complete item field pluginDraws a field's values as radio buttons on the item page
Form field pluginForm field pluginsAdds a one line text field to registration and checkout
Media pluginMedia pluginsStores uploaded pictures as WebP and refuses very large ones
Feature plugin: extend existing admin screensA complete feature pluginAdds a column to the Manufacturers list and refuses some deletes
Feature plugin: add a screen of its ownA complete admin panelAdds its own screen with a list, a form and a table
Joomla system pluginSystem, console and task pluginsLogs completed orders and adds a button to Tools

The two feature plugin starters are the same kind of plugin: both are in the group alfa, and one plugin may do both things. They are offered apart because the manual has one tested example of each. To have both in one plugin, generate one and copy the event handlers of the other into its class, with their entries in getSubscribedEvents() and their files.

The system plugin starter is an ordinary Joomla system plugin, a plugin type of Joomla and not of Alfa Commerce. The starter shows only how such a plugin hears Alfa Commerce. For what else a Joomla plugin can do, and for Joomla's other plugin types, read Joomla's documentation on plugins.

What it is not​

A generated plugin is a starter. It has the right structure and a working demonstration, and it is not an integration with anything:

  • The payment starter talks to no payment provider. It asks for no money, captures none and refunds none.
  • The shipping starter talks to no carrier.
  • The texts of the demonstration (labels, messages) are the example's. Change them in the language files.

Read the comment at the top of the plugin's class first. It lists what you still have to write.

Installing the ZIP​

  1. In the Joomla administrator go to System, Install, Extensions and upload the ZIP.
  2. Joomla installs a new plugin disabled. Enable it under System, Plugins.
  3. A payment, shipping, item field or form field plugin does nothing until a method or a field of its type exists. Create one under Alfa Commerce's Configuration menu.

What can go wrong​

What you seeWhy
The form does not offer a downloadA field is not acceptable. The reason is printed under the form.
The element is refusedIt must be lower case letters and digits, must not be a word of PHP such as list or new, and must not be the element of a plugin Alfa Commerce ships.
Joomla says the extension is already installed and updates itA plugin with the same group and element exists on the site. Choose another element.
A name of the example is still in a textTexts of the demonstration are not changed. Only names are.

How it was checked​

One plugin of every type was generated with a new name and a new vendor, installed on a fresh Alfa Commerce 2.2.0 test shop (Joomla 6.1.4, PHP 8.3), enabled and used: an order was placed with the generated payment, shipping, item field and form field plugins, the payment was marked as paid, a picture was uploaded through the media plugin, and the feature and system plugins were used on their screens.

Not offered yet​

  • A search engine plugin. The manual's example for it is a skeleton that finds nothing.
  • Console and task plugins. Alfa Commerce 2.2.0 has no extension point for either.