Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 General help me questions
 Category display order on left menu
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

allegro
Starting Member

Australia
24 Posts

Posted - April 12 2005 :  19:25:33  Show Profile  Visit allegro's Homepage  Reply with Quote
Hi,
I want to be able to regulate the order in which categories are listed in the left menu down the side of the page, and I can't work out where to do that. I notice that currently the order seems to have no logic to the order in which the list is displayed, and if I change a category name, suddenly it'll move its' way down the list, which makes no sense to me. My preference is to be able to set the order any way I like, ie. if I want Classes to go after Miscellaneous, then I'd like it to do that. so just like I can change the order of the navigation menu items by changing the number assigned to each item, can I do this for categories too?
Thanks,
Helene



Edited by - allegro on April 12 2005 19:29:06

bmw000
VP-CART New User

137 Posts

Posted - April 12 2005 :  21:47:07  Show Profile  Visit bmw000's Homepage  Reply with Quote
I think you need to change xsortcategories

xsortcategories

The sort fields used for categories display. These are fields in the categories table.

I think it sorts it by description by default. My value for xsortcategories = catdescription


Brian Weber
BMW Solutions, LLC
http://www.bmwsolutions.com
Go to Top of Page

allegro
Starting Member

Australia
24 Posts

Posted - April 12 2005 :  23:44:31  Show Profile  Visit allegro's Homepage  Reply with Quote
Hmmm, not sure about that Brian, cos my xsortcategories is also set to catdescription, but the order doesn't seem to follow my category descriptions, well at least not in alphabetic nor numeric order.
Thanks anyway.

Helene

Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - April 13 2005 :  03:39:14  Show Profile  Visit devshb's Homepage  Reply with Quote
I think Brian's right with that setting being relevant/used (ie that's the right value that you should change).

The problem is that there are a handful of functions which don't use that setting when they should (ie a small oversight on the part of vpasp when vpasp were tweaking/building those functions, which may well be fixed in later sub-versions).


shopproductsubs.asp has most of the category listing functions in it, and if you do a search for:

Sub NavigateShowCategories()

and change

catSQL=catsql & " order by catdescription"


to:

catSQL=catsql & " order by "&getconfig("xsortcategories")


then it should then be correct

NavigateShowAllCategories() has the same gap/problem.


Then (if you want to order by something that's not the description etc) you can change your xsortcategories value to catextra and then put your ordering value in the catextra column (ie use catextra purely for ordering purposes, and not for displaying any text)

If you're using Access, and want to ignore case on a description order then you can use a config option:

ucase(catdescription)

for sqlserver or mysql it'd be:

upper(catdescription)


All these "listing" functions seem to have hard-coded ordering in them rather than using the config options, and I've got a feeling that this might well be deliberate (I have no idea, but it might be), because the ordering that you'd want to use in a text list might well need to be logically different to what you'd order by in the proper display pages (eg top-10 list shouldn't order by the same thing that your normal product query does), so this might be deliberate rather than an oversight (this is the glory of having open source; people can use different orders/logic in different pages/functions with relatively little hassle)

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
Web Design, Online Marketing and VPASP addons

Edited by - devshb on April 13 2005 03:45:22
Go to Top of Page

allegro
Starting Member

Australia
24 Posts

Posted - April 13 2005 :  21:59:30  Show Profile  Visit allegro's Homepage  Reply with Quote
Hi Simon,
I did try what you suggested, but unfortunately, I'm not an HTML coder at all, and am still very "green" in this whole field.
After I made the changes to the asp file & uploaded them, I couldn't open my website at all. So I put it all back the way it was.
The error message said there was an open string, or unclosed or something. I should have written it down, but I panicked and wanted to get the site back to working condition. I made a backup copy before I started mucking around, so that was easy to do.
Cheers,
Helene

Go to Top of Page

IfOnly
VP-CART New User

United Kingdom
90 Posts

Posted - April 15 2005 :  05:19:07  Show Profile  Reply with Quote
Hi All

I had to solve the problem by adding a field to the raw database because I wanted to make use of catextra to dispaly the contents of a htm file at the top.

This does work, although requires an extra step when adding new categories:
See java menu on http://moordarts.soon2b.net/shopping (in development) and www.toddschina.co.uk
1. Download the database and add a new column to the categories table; I called it catsort.
2. Upload the database.
3. Login and go to categories, click on the edit link and the category opens up.
4. Near to the top left of the form you will see a text hyperlink 'Edit'; if you click that the category editing form reappears but in a more raw form with the 'catsort' field showing.
5. You can now use numbers, starting at 10, or letters of the alphabet to allocate the categories order.
6. Change xsortcategories to catsort

Regards
Phil
www.sensibleweb.co.uk
Regards

Phil

Edited by - IfOnly on April 15 2005 05:21:20
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - April 15 2005 :  06:02:54  Show Profile  Visit devshb's Homepage  Reply with Quote
That's a good solution too.
What'd be really useful would be if the categories table by default had quite a lot of "other" columns in them, because people need to specify lots of things like this at category level.

For example, you might want to color-code some categories when displaying them, or create extra links/related info etc. I'm hoping that the pending new version will have more category columns like that.

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
Web Design, Online Marketing and VPASP addons
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00