Jump to content

Categories Alphabtized & Number of products


Guest

Recommended Posts

I found 2 different mods i want to imply in my cart, but i can't get them work together.

I want the categories to be in alphabetical order and have them display the number of products beside them:

these changes were made to /include/boxes/categories.inc.php

Mod#1 (# of products)

$results = $db->select("SELECT cat_name, cat_id, noProducts FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0");

Mod#2 (Alpha)

$results = $db->select("SELECT cat_name, cat_id FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0 ORDER BY cat_name ASC");

Combo String that doesn't work:

$results = $db->select("SELECT cat_name, cat_id, noProducts FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0");

Error:Parse error: parse error, unexpected '[' in /home/stiener/public_html/lindamaysgiftbaskets/cart/includes/boxes/categories.inc.php on line 37

What am i doing wrong?

Please help, thank you.

Danny

Link to comment
Share on other sites

Guest estelle

Danny,

I can't see any parse errors in the "combo string" code you posted, so I expect the error may be occuring on a different line in the file. Please double check what code occurs on line 37.

This is the correct merge for the two lines of code is:

$results = $db->select("SELECT cat_name, cat_id, noProducts FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0 ORDER BY cat_name ASC");

Estelle.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...