I was using following code for Check module position. So, It is working fine in OpenCart 1.5.6. When module Enabled in Content left & right panel so I want to hide javascript code in OpenCart
but, it is not working in Opencart 2.0
How can be achieved in Opencart 2.0?
in .tpl file
<?php if ($module['position'] == 'content_bottom' || $module['position'] == 'content_top') { ?>
//add your code Here
<?php } ?>
add in .php file
$this->data['module'] = $setting;
I have found simple solution. This is working like charm.
in .tpl file. (You want to that module. featured.tpl etc...)
<?php if ($module['position'] == 'content_bottom' || $module['position'] == 'content_top') { ?>
//add your code Here
<?php } ?>
add in .php file (You want to that module. featured.php etc...)
$data['module'] = $setting;
catalog/controller/common/{content_top, content_bottom, content_right, content_left}.php,
Find the below code
if (isset($part[1]) && isset($setting[$part[1]])) {
and add the below code after
$setting[$part[1]]['position'] = basename(__FILE__, '.php');
catalog/controller/common/{content_top, content_bottom, content_right, content_left}.php,
Find the below code
$setting_info = $this->model_extension_module->getModule($part[1]);
and add the below code after
$setting_info['position'] = basename(__FILE__, '.php');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With