Auto Inclusion System

What files are automatically included?

To reduce the number of changes required for plugin authors, Zen Cart does some automatic inclusion of files.

Functions

Any *.php files placed in includes/functions/extra_functions are loaded automatically, and can be called by any storefront side logic. Similarly, on the admin side, functions in admin/includes/functions/extra_functions are automatically loaded.

Language Files

  • A storefront side page will automatically load its own language file. So the page includes/modules/pages/contact_us/ will load includes/languages/english/contact_us.php
  • All files in includes/languages/english/extra_definitions are automatically loaded.

Extra Datafiles, Extra Configures, Extra Cart Actions

Any *.php files in this folder are loaded automatically.

See Extra folders for a complete list.

Auto Loaded Observers

These are described in the Notifiers and Observers documentation. Auto-loaded Observer files include those in includes/classes/observers (and Admin) whose name begins with auto. and which define a class named zcObserver + the CamelCased filename - for example, class zcObserverFooObserver.

Stylesheets

A number of stylesheets are automatically loaded; this process is described in the stylesheet documentation.




Still have questions? Use the Search box in the upper right, or try the full list of FAQs. If you can't find it there, 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 February 21, 2021 by Scott C Wilson (7b80c08).