CubeCartForums.org Documentation Area

CubeCartForums.org for CubeCart third-party documentation, modifications, skins and services
Permanent Link   Print This Page
Introduction CubeCart v3 CubeCart v4 CubeCart v5 Appendix Search

CubeCart Version 3 Documentation - Changing the order of the Categories and Documents Menu

Google Translate:

Changing the order of the Categories and Documents Menu

Category Menu

By default there is no set order given to the categories side box.

To set the order to a specific preset pattern, follow these instructions:

1. Find the following file:

/includes/boxes/categories.inc.php

2. Edit the file, and look for the following code around line 36:
// query database
$results = $db->select("SELECT cat_name, cat_id FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0");
3. At the end of the SQL statement, add 'ORDER BY cat_id ASC', so the line now looks like this:
// query database
$results = $db->select("SELECT cat_name, cat_id FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0 ORDER BY cat_id ASC");
The text in bold is the text we have added. You can change the order of the categories by replacing the 'cat_id ASC' to order the categories using which ever information you would prefer.

Below is a table of possible category orders:

SQL Description
cat_id ASC Order by category ID in ascending order.
cat_id DESC Order by category ID in descending order.
cat_name ASC Order by category name in ascending order.
cat_name DESC Order by category name in descending order.

Site Documents Menu

By default thte order of the site documents is by name in ascending order. This can be changed if required.

To set the order to a specific preset pattern, follow these instructions:

1. Find the following file:

/includes/boxes/siteDocs.inc.php

2. Edit the file, and look for the following code around line 36:
// query database
$results = $db->select("SELECT doc_id, doc_name FROM ".$glob['dbprefix']."CubeCart_docs ORDER BY doc_name ASC");
3. At the end of the SQL statement you can see 'ORDER BY doc_name ASC'. Just replace the 'doc_name ASC' by one from this list perhaps:

SQL Description
doc_id ASC Order by document ID in ascending order.
doc_id DESC Order by document ID in descending order.
doc_name ASC Order by document name in ascending order.
doc_name DESC Order by document name in descending order.




Comments, Feedback, Suggestions and Documentation Submissions please post in the Documentation Chat Forum.