dongruidian3064 2015-02-16 13:54
浏览 32
已采纳

将新模块位置添加到OpenCart 2

I want to add more Positions for modules. How can I add a new module position in opencart 2?

Here, I like this information. but, it is work only for OpenCart older version. http://www.opencartnews.com/tutorials/adding-new-modules-positions/

How can the same thing be achieved in Opencart 2?

Please help...!

  • 写回答

2条回答 默认 最新

  • dongqin5604 2015-02-27 14:44
    关注

    You can achieve this by modifying the following core file.

    1. admin/view/template/design/layout_form.tpl add your new position in this select tag

      <select name="layout_module[<?php echo $module_row; ?>][position]"

      and also in this method at the bottom of the file

      function addModule() {

    2. And then you have to add a template and a controller in catalog/view/theme/default/template/common you can use the same code as it is in content_top.php & content_top.tpl, just rename the file as your new position name.

    3. And then in Home controller or any other page where this position is required, you have to add

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

    4. After adding it to controller, you need to add it to the template files. Add to all the page templates you want to show the custom position on.

      <?php echo $new_position; ?>

    For example, to show the position on the home page, you'll add <?php echo $new_position; ?> to catalog/view/theme/YOUR_THEME/template/common/home.tpl

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 etcd集群部署问题
  • ¥20 谁可以帮我一下问一下各位
  • ¥15 为何重叠加权后love图的SMD与svyCreateTableOne函数绘制基线表的不一致
  • ¥15 QFILHelper怎么恢复全字库,提示进程已完成,只能恢复分区文件
  • ¥150 求 小魔指游戏板整合模拟软件
  • ¥20 你好,我想问下easyExcel下拉多选,或者复选框可以实现吗
  • ¥20 双非跨考工科哪个专业和方向就业前景好?
  • ¥20 求会6sv辐射传输模型,辅导(可py6s🙏🏻有偿
  • ¥15 .xla后缀的文件拖到excel里什么内容也没有怎么办
  • ¥20 Workbench中Mechanical打不开、闪退是什么原因?