Jump to content

Show Number Of Products In Category?


Guest SweetNightshade

Recommended Posts

Guest SweetNightshade

My employer wants me to figure out how to show the number of items in each category on the category side-bar. URL is www.sheetmusicstorehouse.com Any suggestions?

Link to comment
Share on other sites

The category admin section shows these values, so we just need to copy the query.

In the file \includes\boxes\categories.inc.php, find the line that has:

$results = $db->select("SELECT cat_name, cat_id FROM
and change it to:


$results = $db->select("SELECT cat_name, cat_id, noProducts FROM




Now we need to tweak the template. Find the file \skins\YOUR_SKIN\styleTemplates\boxes\categories.tpl, find the line that has:


{DATA.cat_name}
and change it to:


{DATA.cat_name} ({DATA.noProducts})

See how that flies.

Link to comment
Share on other sites

  • 2 weeks later...
Guest SweetNightshade

The category admin section shows these values, so we just need to copy the query.

In the file \includes\boxes\categories.inc.php, find the line that has:

$results = $db->select("SELECT cat_name, cat_id FROM
and change it to:


$results = $db->select("SELECT cat_name, cat_id, noProducts FROM




Now we need to tweak the template. Find the file \skins\YOUR_SKIN\styleTemplates\boxes\categories.tpl, find the line that has:


{DATA.cat_name}
and change it to:


{DATA.cat_name} ({DATA.noProducts})

See how that flies.

You are awesome, worked like a charm. Thanks.

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...