屬性的排序有三個方式:sort_order, attr_price, goods_attr_id
如果要修改的話,修改 includes/lib_goods.php檔案的 get_goods_properties()函數。
找到 ORDER BY a.sort_order, g.attr_price, g.goods_attr_id 這裡,改為:
ORDER BY g.goods_attr_id 這樣就是以你的輸入順序來顯示了。
情況一:添加新産品時,讓屬性按照添加的順序(屬性id)排列
修改/inclues/lib_goods.php
$sql = "SELECT a.attr_id, a.attr_name, a.attr_group, a.is_linked, a.attr_type, ".
"g.goods_attr_id, g.attr_value, g.attr_price " .
'FROM ' . $GLOBALS['ecs']->table('goods_attr') . ' AS g ' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('attribute') . ' AS a ON a.attr_id = g.attr_id ' .
"WHERE g.goods_id = '$goods_id' " .
'ORDER BY g.goods_attr_id, a.sort_order, g.attr_price';
$res = $GLOBALS['db']->getAll($sql);
轉載于:https://www.cnblogs.com/sanwenyu/p/4045387.html