close

目前OpenCart現有的位置有

1. Content Top --- 置頂

2. Content Bottom --- 底部

3. Colume Left --- 左欄

4. Colume Right --- 右欄

 

 

開始

在開始之前您須具備....

  1. 基本PHP概念
  2. 基本HTML概念
  3. 基本CSS概念
  4. 程式碼撰寫工具

建立新位置-命名為Content Footer

在 catalog/controller/common/ 放入 content_footer.php 檔案

1. content_footer.php

 

 

在 catalog/view/theme/你的主題/template/common/ 放入 content_footer.tpl 檔案

2. content_footer.tpl

 

 

 

三  修改程式碼:設定你要放置的地方 以footer為例

1. 開啟 catalog/controller/common/footer.php 檔案然後搜尋 $this->children = array(

2. 在裡面加入一行 'common/content_footer'

3 .開啟 catalog/view/theme/default/template/common/footer.tpl 然後選擇你的新位置要放置的地方加入<?php echo $content_footer; ?>

 

四  將你要放的模組指定到Content Footer的位置上 featured為例

1. 開啟 admin/view/template/module/featured.tpl 

2. 在 <?php if ($module['position'] == 'content_top') { ?> 前面加上下列程式碼

 

 

3. 在 html += '<option value="content_top"><?php echo $text_content_top; ?></option>'; 前面加上 html += '<option value="content_footer">Content Footer</option>';

 

五 到後台開啟Featured模組(推薦商品模組)

多出一個位置選項啦!

arrow
arrow

    蘇姵欣 PeiSu 發表在 痞客邦 留言(0) 人氣()