A free, commented manifest.php for encapsulated Zen Cart plugins that puts three buttons under your plugin's description in Plugin Manager: Read Me, GitHub and Forum Support Thread. It's the manifest every one of our free plugins uses, with our details taken out.
Download the Example (zip)
Why the Buttons Go in the Description
Plugin Manager in Zen Cart 1.5.8 through 3.0.0 shows a plugin's name, description, author and version, and uses its Plugin ID to check for updates. The manifest docs also list changelog and github_repo, but nothing in core reads either one yet, so a store owner never sees them. The description is printed as HTML, which makes it the one place a link actually reaches the owner.
You Have All Three Links Before You Submit
The read-me ships inside your plugin folder, the GitHub repository is yours, and you can start the forum support thread first (the Plugins Library's submission form asks for it anyway). So the links can be right in version 1.0.0. That matters on Zen Cart 1.5.8, 2.0 and 2.1, where Plugin Manager saves the description only the first time it sees a plugin. Zen Cart 2.2 and later refresh it on every Plugin Manager visit.
How to Use It
- Copy it to
zc_plugins/YourPluginKey/v1.0.0/manifest.php.
- Change every value marked
CHANGE: the folder path, your GitHub and forum URLs, the name, description and author, and the Zen Cart versions you've tested.
- Leave a URL as
'' until it exists. Its button stays hidden, so nobody clicks a link that goes nowhere.
- Write
pluginId as a bare number, 0 until the Plugins Library assigns one. The Library writes the assigned ID into your zip, and it can't replace a quoted '0'.
- Make
pluginVersion match your Library release exactly, v included, or update notices won't work.
The Code
<?php
/**
* Example manifest.php for an encapsulated Zen Cart plugin, with Read Me,
* GitHub and Forum Support Thread buttons in Plugin Manager.
*
* Copy this file to zc_plugins/<YourPluginKey>/<version>/manifest.php and change
* the values marked CHANGE. Everything else can stay as it is.
*
* Why the buttons go in pluginDescription: core Plugin Manager (1.5.8 through
* 3.0.0) displays pluginName, pluginDescription, pluginAuthor and the version,
* and uses pluginId for update checks. The 'changelog' and 'github_repo' keys
* are documented, but nothing in core reads them yet. pluginDescription is
* printed as HTML in Plugin Manager's info box, so a row of links there is the
* one place a store owner will actually see them.
*
* All three links exist before you submit to the Plugins Library: the read-me
* ships inside the plugin, the GitHub repository is yours, and you can start
* the forum support thread first (the Library's submission form asks for it).
*
* Two things to know about older stores:
* - On Zen Cart 1.5.8, 2.0 and 2.1, Plugin Manager saves the description
* only the first time it sees the plugin, so get the links right before
* the first release. 2.2 and later refresh it on every Plugin Manager load.
* - Write pluginId as a bare number (0 until the Library assigns one). The
* Library replaces the number in your zip, and it can't replace a quoted one.
*
* Example from My Zen Cart Zone (https://www.myzencartzone.com), free to copy
* and adapt.
*
* @license GNU General Public License v2.0 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
*/
// CHANGE: the folder this manifest is in, relative to the store root.
$examplePluginDir = 'zc_plugins/MyPlugin/v1.0.0/';
// CHANGE: the read-me that ships in the plugin folder. The link is built from
// the catalog path so it works for stores installed in a subfolder.
$exampleReadmeUrl = (defined('DIR_WS_CATALOG') ? DIR_WS_CATALOG : '/') . $examplePluginDir . 'readme.html';
// CHANGE: your repository and forum support thread. Leave either one as ''
// until it exists; its button won't show while it's empty (a link that 404s
// is worse than no link).
$exampleGithubUrl = 'https://github.com/your-name/your-plugin';
$exampleForumUrl = 'https://www.zen-cart.com/threads/000000';
// One button. btn btn-primary is the admin's own Bootstrap style, so the row
// matches the rest of Plugin Manager.
$exampleButton = static function ($url, $label) {
return '<a href="' . htmlspecialchars($url, ENT_QUOTES, 'UTF-8') . '" target="_blank" rel="noopener noreferrer"'
. ' class="btn btn-primary" role="button" style="margin:0 6px 0 0">' . $label . '</a>';
};
$exampleLinks = '<div style="margin:10px 0 0">'
. $exampleButton($exampleReadmeUrl, 'Read Me')
. ($exampleGithubUrl !== '' ? $exampleButton($exampleGithubUrl, 'GitHub') : '')
. ($exampleForumUrl !== '' ? $exampleButton($exampleForumUrl, 'Forum Support Thread') : '')
. '</div>';
return [
'pluginVersion' => 'v1.0.0', // CHANGE: same string, v included, as the Library release
'pluginName' => 'My Plugin', // CHANGE
'pluginDescription' =>
'One or two plain sentences on what the plugin does for the store owner.' // CHANGE
. $exampleLinks,
'pluginAuthor' => 'Your Name (your forum name)', // CHANGE
'pluginId' => 0, // Plugins Library ID; a bare number, never quoted
'zcVersions' => ['v158', 'v200', 'v210', 'v220', 'v230', 'v300'], // CHANGE: versions you've tested
'changelog' => 'changelog.txt', // file in this folder, or a URL
'github_repo' => $exampleGithubUrl,
'pluginGroups' => [],
];
Free to copy and adapt under the GNU General Public License v2.0. Questions or ideas? Contact us.