File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
app/code/core/Mage/Catalog/Model/Resource Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -727,7 +727,8 @@ public function getChildren($category, $recursive = true)
727
727
'c.attribute_id = :attribute_id AND c.store_id = :store_id AND c.entity_id = m.entity_id ' ,
728
728
array ()
729
729
)
730
- ->where ($ checkSql . ' = :scope ' );
730
+ ->where ($ checkSql . ' = :scope ' )
731
+ ->order ("m.position ASC " );
731
732
732
733
return $ adapter ->fetchCol ($ select , $ bind );
733
734
}
Original file line number Diff line number Diff line change @@ -1311,15 +1311,18 @@ public function isInRootCategoryList($category)
1311
1311
*/
1312
1312
public function getChildren ($ category , $ recursive = true , $ isActive = true )
1313
1313
{
1314
+ $ maintable = $ this ->getMainStoreTable ($ category ->getStoreId ());
1314
1315
$ select = $ this ->_getReadAdapter ()->select ()
1315
- ->from ($ this ->getMainStoreTable ($ category ->getStoreId ()), 'entity_id ' )
1316
- ->where ('path LIKE ? ' , "{$ category ->getPath ()}/% " );
1316
+ ->from ($ maintable , 'entity_id ' )
1317
+ ->where ('path LIKE ? ' , "{$ category ->getPath ()}/% " )
1318
+ ->order ($ maintable .".position ASC " );
1317
1319
if (!$ recursive ) {
1318
1320
$ select ->where ('level <= ? ' , $ category ->getLevel () + 1 );
1319
1321
}
1320
1322
if ($ isActive ) {
1321
1323
$ select ->where ('is_active = ? ' , '1 ' );
1322
1324
}
1325
+
1323
1326
$ _categories = $ this ->_getReadAdapter ()->fetchAll ($ select );
1324
1327
$ categoriesIds = array ();
1325
1328
foreach ($ _categories as $ _category ) {
You can’t perform that action at this time.
0 commit comments