Help with Encapsulated Plugins
I am in the process of migrating some plug-ins to 2.1 and I'd like to move some of the simpler ones to zc_plugin as well as trying to learn.
Using this guide: https://docs.zen-cart.com/dev/plugin...ins/converting
as well as this section: https://docs.zen-cart.com/dev/plugin...lated_plugins/ and the directory structure section.
My plug ins template override is in:
./zc_plugins/MyPlugin/2025.6.4/catalog/includes/templates/default/templates/tpl_account_default.php but for some reason it is not loading.
I am using ZCA Bootstrap-4 as a template if that matters.
Thanks!
Re: Help with Encapsulated Plugins
Digging a little further, I can obviously override by putting my template files under the Bootstrap folder. The question is, how does the encapsulated plugin system override the custom folder templates?
Re: Help with Encapsulated Plugins
An encapsulated plugin can provide the default template for any added page, but cannot (currently) override the template for any base Zen Cart page (e.g. account, in your example).
Dealing with those base pages' additions by encapsulated plugins depend on the presence of notifications within those template modules (and there aren't man7!). You could use what I did with the How Did You Hear About Us (https://www.zen-cart.com/downloads.php?do=file&id=90) plugin, which provided a combination of a default template for its added page and the use of jQuery/javascript to inject any changes to built-in pages' templates.
Re: Help with Encapsulated Plugins
Quote:
Originally Posted by
lat9
An encapsulated plugin can provide the default template for any
added page, but cannot (currently) override the template for any base Zen Cart page (e.g. account, in your example).
Dealing with those base pages' additions by encapsulated plugins depend on the presence of notifications within those template modules (and there aren't man7!). You could use what I did with the How Did You Hear About Us (
https://www.zen-cart.com/downloads.php?do=file&id=90) plugin, which provided a combination of a default template for its added page and the use of jQuery/javascript to inject any changes to built-in pages' templates.
That's smart, thanks for the tip - will look into how I can make it work for my plugin.
Does that mean that zc_plugins only works on the default template for template overrides? That's a serious drawback for the whole encapsulated plugin move. Would encapsulating the bootstrap template itself make this work, or will it still have to be overridden at the template level when using a non-default template?