
Originally Posted by
chadlly2003
This is just my opinion regarding the encapsulated plugins. I feel like this was not the best approach. Burying CSS inside isolated plugin directories is a massive step backward for the front-end workflow. It completely bypasses Zen Cart’s native template override system, meaning we lose that direct, 1-to-1 control over layouts that made the platform great. Instead of writing clean, modular styles, we're now stuck piling on redundant CSS. rules. It’s a mess that’s going to cause serious headache and maintenance issues for future site builds."
I noticed this when i was working on my demo site. It was very easy to spot and so i felt i wanted to address the issue and get some feedback
Depends on the plugin. POSM, for instance, provides a default set of CSS that's loaded, but if the site's specified an override then that version's loaded next (which could override the default values. See POSM's catalog/includes/classes/observers/class.products_options_stock_observer.php:
Code:
// -----
// Look for any plugin's stylesheet, first in the as-distributed 'default'
// and then for any overrides present in the site's active template.
//
$stylesheet = 'options_stock_styles.css';
echo '<link rel="stylesheet" href="' . $this->getZcPluginDir() . DIR_WS_TEMPLATES . "default/css/$stylesheet" . '">' . "\n";
$stylesheet_dir = $template->get_template_dir($stylesheet, DIR_WS_TEMPLATE, $current_page_base, 'css');
$stylesheet_dir .= '/' . $stylesheet;
if (!str_contains($stylesheet_dir, $this->getZcPluginDir()) && file_exists($stylesheet_dir)) {
echo '<link rel="stylesheet" href="' . $stylesheet_dir . '">' . "\n";
}