Just an Enthusiast. I wish we had computers at school!
Good Luck

Ernie
---
https://www.opencart.com/index.php?rout ... n_id=19455
Code: Select all
<?php
class ControllerModuleLbNotify extends Controller {
public function index($setting) {
$this->language->load('module/lbnotify');
// Stylesheets
if (file_exists('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/lbnotify/lbnotify.css')) {
$this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/lbnotify/lbnotify.css');
} else {
$this->document->addStyle('catalog/view/theme/default/stylesheet/lbnotify/lbnotify.css');
}
//JavaScript
$this->document->addScript('catalog/view/javascript/lbnotify/lbnotify.js');
$description = isset( $setting['description'][$this->config->get('config_language_id')] ) ? $setting['description'][$this->config->get('config_language_id')] : "";
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
This is my code v2.3.0.2:
Code: Select all
<?php
class ControllerExtensionModuleIconMenu extends Controller {
private $_route = 'extension/module/icon_menu';
public function index() {
$data['template'] = $this->config->get('config_theme');
//ADD-ON SCRIPTS(doesn't work for some reason added in header.tpl instead)
$this->document->addStyle('catalog/view/theme/'.$data['template'].'/js/'.$this->_route.'/fisheye.css');
$this->document->addScript('catalog/view/theme/'.$data['template'].'/js/'.$this->_route.'/fisheye.js');
Its not really a problem because it is part of the theme anyway. But i just wondered why when adding a module into the catalog\controller\common\header.php via a modification:
Code: Select all
$data['icon_menu'] = $this->load->controller('extension/module/icon_menu');
Its probably a loading thing ,addStyle and addscript doesn't work, when a module is added this way?
Not a problem, it works when i add the scripts to the theme header.tpl.Just wondered why?
Thanks for your reply.
Just an Enthusiast. I wish we had computers at school!
But just to make sure, did you CLEAR OUT your OcModification and VqCache
section, every time, after you made changes ? Because otherways, the
system will still 'present' the old cached File-Content.
Good Luck

Ernie
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
So header controller should finally look like this:
Code: Select all
.....
$data['icon_menu'] = $this->load->controller('extension/module/icon_menu');
$data['links'] = $this->document->getLinks();
$data['styles'] = $this->document->getStyles();
$data['scripts'] = $this->document->getScripts('header');
$data['lang'] = $this->language->get('code');
$data['direction'] = $this->language->get('direction');
......
Code: Select all
<file error="log" path="catalog/controller/common/header.php">
<operation error="log">
<search index="0">
<![CDATA[$data['links'] = $this->document->getLinks();]]>
</search>
<add position="before">
<![CDATA[
$data['icon_menu'] = $this->load->controller('extension/module/icon_menu');
]]>
</add>
</operation>
</file>
Your skilled IT team
The right experts in solving business tasks of any complexity.
Well, rest assured that the original poster from seven years ago has long since then found a suitable solution

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Users browsing this forum: No registered users and 2 guests