Opencart 3类别描述可见性问题

问题描述 投票:1回答:1

我正在运行OC 3.0.2.0并寻找仅在类别第一页上显示类别描述的方法,并将其隐藏在1,2,3页等等。

我必须编辑category.twig文件,但我不熟悉语法。

我找到了一些代码,但它适用于旧版本的OC。

opencart categories
1个回答
0
投票

打开控制器\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:添加此字符串

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.