方法来自网络:
方法如下,默认显示就为货号排序
一、目录排序:
1)language/zh_cn/common.php 加
$_LANG[‘sort’][‘goods_sn’] = ‘按货号排序’;
2) category.php 行 60 左右
/* 排序、显示方式以及类型 */
$default_display_type = $_CFG[‘show_order_type’] == ‘0’ ? ‘list’ : ($_CFG[‘show_order_type’] == ‘1’ ? ‘grid’ : ‘text’);
$default_sort_order_method = $_CFG[‘sort_order_method’] == ‘0’ ? ‘DESC’ : ‘ASC’;
$default_sort_order_type = $_CFG[‘sort_order_type’] == ‘0’ ? ‘goods_sn’ : ($_CFG[‘sort_order_type’] == ‘1’ ? ‘shop_price’ : ‘goods_sn’);$sort = (isset($_REQUEST[‘sort’]) && in_array(trim(strtolower($_REQUEST[‘sort’])), array(‘goods_id’, ‘shop_price’, ‘last_update’,‘goods_sn’))) ? trim($_REQUEST[‘sort’]) : $default_sort_order_type;
二、搜索页面
search.php,232行左右
/* 排序、显示方式以及类型 */
$default_display_type = $_CFG[‘show_order_type’] == ‘0’ ? ‘list’ : ($_CFG[‘show_order_type’] == ‘1’ ? ‘grid’ : ‘text’);
$default_sort_order_method = $_CFG[‘sort_order_method’] == ‘0’ ? ‘DESC’ : ‘ASC’;
$default_sort_order_type = $_CFG[‘sort_order_type’] == ‘0’ ? ‘goods_sn’ : ($_CFG[‘sort_order_type’] == ‘1’ ? ‘shop_price’ : ‘goods_sn’);
$sort = (isset($_REQUEST[‘sort’]) && in_array(trim(strtolower($_REQUEST[‘sort’])), array(‘goods_id’, ‘shop_price’, ‘last_update’,‘goods_sn’))) ? trim($_REQUEST[‘sort’]) : $default_sort_order_type;
评论前必须登录!
注册