Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Category sort order help

Category sort order help

Views: 936

Results 1 to 8 of 8
7 Oct 2011, 3:18 PM
#1
igi2011 avatar

igi2011

New Zenner

Join Date:
Oct 2011
Location:
Kent, UK
Posts:
50
Plugin Contributions:
0

Category sort order help

Hi all,

Our homepage (www.nee dth atg ift .co.uk) currently has a list of categories in the left sidebar, and the same categories plus images in the centre.

I've managed to customise the category sort order, but ideally what I'd like to do is have an alphabetical sort order in the left sidebar but retain the custom sort order in the centre. Is this possible?

Thanks in advance

10 Oct 2011, 9:40 AM
#2
igi2011 avatar

igi2011

New Zenner

Join Date:
Oct 2011
Location:
Kent, UK
Posts:
50
Plugin Contributions:
0

Re: Category sort order help

bump

can anyone help?

10 Oct 2011, 9:49 AM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Category sort order help

This cannot be done... Unless of course you want to write hundreds of lines of code... (perhaps thousands of lines).

10 Oct 2011, 10:03 AM
#4
igi2011 avatar

igi2011

New Zenner

Join Date:
Oct 2011
Location:
Kent, UK
Posts:
50
Plugin Contributions:
0

Re: Category sort order help

Bah. That's a shame... thanks anyway.

28 Oct 2011, 9:59 AM
#5
igi2011 avatar

igi2011

New Zenner

Join Date:
Oct 2011
Location:
Kent, UK
Posts:
50
Plugin Contributions:
0

Re: Category sort order help

Just a quick update in case anyone else has the same problem... I've managed to get round this (up to a point) by using a blank sidebox in place of the category menu on the left.

As we already had one instance of blank sidebox, I changed all filenames and references within these files from "blank_sidebox" to "category_sidebox".

28 Oct 2011, 7:02 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Category sort order help

igi2011:

Just a quick update in case anyone else has the same problem... I've managed to get round this (up to a point) by using a blank sidebox in place of the category menu on the left.

As we already had one instance of blank sidebox, I changed all filenames and references within these files from "blank_sidebox" to "category_sidebox".

Yes... a good solution!

As you know, however... the list in the blank sidebox must be MANUALLY edited.

I was actually wondering if this couldn't be achieved by using two PRODUCT TYPES (Product General and Document General), where you create similar categories, then LINK all products to the relevant categories.

You could use the documents categories sidebox for the left, and hide the convetional sidebox, but continue to display categories on main page.

we did something SIMILAR HERE.

See the nav cat tabs menu (horizontal menu bar) and the cateogries menu are different... The menu bar uses product_general and the sidebox uses document_general

29 Oct 2011, 12:13 AM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Category sort order help

It might be possible to set the sort in the categories sidebox differently by altering the select in /includes/classes/sideboxes/categories_tree.php. There are four sections like this:```php
$this->tree = array();
if ($product_type == 'all') {
$categories_query = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where c.parent_id = 0
and c.categories_id = cd.categories_id
and cd.language_id='" . (int)$_SESSION['languages_id'] . "'
and c.categories_status= 1
order by sort_order, cd.categories_name";
} else {

order by sort_order, cd.categories_name";
to
order by cd.categories_name, sort_order";
where desired (perhaps always).

I don't know if that by itself would take care of the display order properly, but it might be worth trying.
29 Oct 2011, 12:21 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Category sort order help

Looking at this some more, this query only addresses top categories, ordering first by sort order and then by name, so it should work simply as described. If you don't need the cat-tabs to display differently from the categories sidebox, just switching the order should work without any testing needed.