1

Opencart has a four layout left ,right Top and a Bottom.Adding new custom positions manually is not impossible of course, but ideally that needs to be done at the core.

Something like "header-bottom" or "footer-top" would be very useful for many modules, like "Menus" and "Slideshows".

how can we create a position like as above for the 2.0.1.1 opencart version

please help me thanks

avktech
  • 92
  • 1
  • 11

1 Answers1

2

I m making

footer_top POSITION similarly you can make any position

Add code in opencart2\catalog\controller\common\home.php line 15(you can understand where to put this line or ask it)

$data['footer_top'] = $this->load->controller('common/footer_top');

And Add this code in opencart2\catalog\view\theme\default\template\common\home.tpl on line 13

 <div id="content" class="col-sm-12"><?php echo $footer_top; ?></div>

copy -> opencart2\catalog\controller\common\content_top.php

to ----> opencart2\catalog\controller\common\footer_top.php

And change line 44

from

$modules = $this->model_design_layout->getLayoutModules($layout_id, 'content_top');

to

$modules = $this->model_design_layout->getLayoutModules($layout_id, 'footer_top');

Open opencart2\admin\view\template\design\layout_form.tpl and add this code In select position dropdown options

    <?php if ($layout_module['position'] == 'footer_top') { ?>
            <option value="footer_top" selected="selected">footer top</option>
            <?php } else { ?>
            <option value="footer_top">footer top</option>
            <?php } ?>

And Add below code after

html += '    < option value="content_top"><?php echo $text_content_top; ?>< /option>'; 

line in addmodule() function

html += '    < option value="footer_top">footer top< /option>';

And check in Position

opencart2/admin/index.php?route=design/layout/edit&token=7ddf86dsfdsfsdfdsfsdfdsfsdf5df&layout_id=1

StackQA
  • 231
  • 1
  • 13