我正在运行OC 3.0.2.0并寻找仅在类别第一页上显示类别描述的方法,并将其隐藏在1,2,3页等等。
我必须编辑category.twig
文件,但我不熟悉语法。
我找到了一些代码,但它适用于旧版本的OC。
打开控制器\catalog\controller\product\category.php
和搜索代码:
if ($category_info) {
/* here code */
..........
$data['page'] = $page; // adding this code
$this->response->setOutput($this->load->view('product/category', $data));
}
打开模板\catalog\view\theme\default\template\product
搜索:
{% if description %}
<div class="col-sm-10">{{ description }}</div>
{% endif %}
更换:
{% if description and page == 1 %}
<div class="col-sm-10">{{ description }}</div>
{% endif %}
第一部分的UPD:添加此字符串