When module Enabled in Content left & right panel so I want to hide javascript code in OpenCart

StackOverflow https://stackoverflow.com/questions/23675545

  •  23-07-2023
  •  | 
  •  

質問

I have add small javascript code in featured.tpl module OpenCart. So, when, featured module Enabled in Content top & bottom part. so, I want to show(run) it javascript code. but, when featured module Enabled in Content left & right panel. so, I want to hide(not run) it javascript code.

Please guide me :)

役に立ちましたか?

解決

I have found solution.

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;
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top