I have follow this answer Check module position in OpenCart 2.0 and it is working fine When add it code direct in core file.
But, when, this same code (Step 3) add via Vqmod (without change core file). So, It is not work. Get error ( Notice: Undefined index: position in.... )
Our Vqmod Code.
<file path="catalog/controller/common/" name="content_top.php,content_bottom.php,content_right.php,content_left.php">
<operation>
<search position="after">
<![CDATA[$setting_info = $this->model_extension_module->getModule($part[1]);]]>
</search>
<add>
<![CDATA[$setting_info['position'] = basename(__FILE__, '.php');]]>
</add>
</operation>
</file>
I am used OpenCart Version 2.0.1.1
How to fix it?
=== Update ===
changed code in vqcache file.
if (isset($part[1])) {
$setting_info = $this->model_extension_module->getModule($part[1]);
if(!isset($setting_info['position'])){
$setting_info['position'] = basename(__FILE__, '.php');
}
if ($setting_info && $setting_info['status']) {
$data['modules'][] = $this->load->controller('module/' . $part[0], $setting_info);
}
When module Enabled in Left/right column. So, do get below error.
Notice: Undefined index: position in C:\......\template\module\featured.tpl on line 1
When module Enabled in Top/bottom column. So, do nothing display.
$setting_info['position'] = basename(__FILE__, '.php');
Direct in file. So, it is working fine. but, it is add via vqmod. So, It is not work. – HDP