Directory Structure

Directory Structure

Plugins written for the new architecture will reside in the zc_plugins directory.

Within their directory plugin authors can add subdirectories that mimic the main Zen Cart directories.

Note how each plugin starts with a versioned directory. This allows for automated upgrades and the possibility of downgrading as well.

Note that the admin folder must be called admin here (not renamed).

e.g.

  • zc_plugins

    • rewardPoints

      • v1.0.0

        • manifest.php

        • Installer

        • admin

          • includes
            • auto_loaders
            • init_includes
            • extra_datafiles
            • classes
            • languages
        • catalog

          • includes

            • functions

              • extra_functions
          • templates

          • etc

      • v1.0.1

        • manifest.php

        • Installer

        • admin

          • includes
            • auto_loaders
            • init_includes
            • extra_datafiles
            • classes
            • languages
        • catalog

          • includes

            • functions

              • extra_functions
          • templates

          • etc

NOTE: While these examples mention the catalog subdirectory, Zen Cart v1.5.7 only supports admin-side plugins at this time.

ALSO: None of this works before Zen Cart v1.5.7: Plugins for prior versions must be installed directly into the main Zen Cart directory structure.

NOTE: The Installer folder is optional; you can embed the installation logic in your plugin if you prefer. See Installer Classes and Plugin SQL Installation for details on using the Installer folder.




Still have questions? No problem! Just head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified September 13, 2020 by Scott C Wilson (354bf51).