优化分类页面的分类树,使用缓存机制,避免分类过多的情况下生成新的缓存时占用过多系统资源
找到themes/shop/library/lyecs_category_tree_all.lbi
1、找到代码:
{if $categories}
替换为:
{if $all_category}
2、找到:
{foreach from=$categories item=cat name=categories}
替换为:
{foreach from=$all_category item=cat name=categories}
3、到该文件最后面添加以下代码
<script type="text/javascript"> var category_id='{$category}'; $('#side_cat_'+category_id).addClass('current'); </script>4、找到themes/shop/lbirary/functions/lyecs.com.php
将代码:
$GLOBALS['smarty']->assign('categories', lyecs_get_categories_tree_all($id));
直接删掉或用//注释掉