Skip to content

Add encapsulated-plugin compatibility for Zen Cart 2.2.1#59

Open
Iscarly-Mr wants to merge 1 commit intolat9:masterfrom
Iscarly-Mr:feature/zc221-encapsulated-support
Open

Add encapsulated-plugin compatibility for Zen Cart 2.2.1#59
Iscarly-Mr wants to merge 1 commit intolat9:masterfrom
Iscarly-Mr:feature/zc221-encapsulated-support

Conversation

@Iscarly-Mr
Copy link
Copy Markdown

This PR adds compatibility for using SitemapXML as an encapsulated plugin on Zen Cart 2.2.1 while retaining support for the classic installation layout.

Summary of changes:

  • In storefront header_php.php, load sitemapxml.php from the plugin-local classes directory when present, falling back to the classic core path otherwise.
  • In storefront header_php.php, discover sitemapxml_*.php generator modules from the plugin-local page directory first, then fall back to the classic core path.
  • In YOUR_Admin/sitemapxml.php, discover the available sitemap generator modules from the plugin-local directory first, then fall back to the classic core path.
  • Update the README to note Zen Cart 2.2.1 support and mention encapsulated-plugin usage and file-permission considerations.

Why:

  • When packaged as an encapsulated plugin in zc_plugins, the current v4.0.5 code still looks for the sitemap class and generator modules in the classic core locations. That leaves the admin generator list empty and prevents sitemap generation.
  • These changes allow the same codebase to work in both classic and encapsulated installation styles.

Validation:

  • Tested with Zen Cart 2.2.1 in an encapsulated-plugin deployment.
  • Verified that the admin page lists the sitemap generator modules correctly.
  • Verified that sitemap generation works after installation and configuration.
  • Ran PHP lint on the modified files.

@lat9
Copy link
Copy Markdown
Owner

lat9 commented Mar 31, 2026

I'm sorry, but while I applaud your efforts I can't accept this change as it's not a "proper" encapsulated plugin. When the SitemapXML "goes encapsulated", it will drop support for the unencapsulated/classic versions and make modifications to its distribution to host all files in their zc_plugins directory. It'll also remove use of the admin's init_includes files, moving those to a ScriptedInstaller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants