View Single Post
  #1  
Old 06-24-2004, 06:10 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,091
 

Default Grouping Categories for better viewing

I've done this for a customer and helped someone out on the forums with this and thought it might be useful to post here.

This will basically get you started on how to group your main categories for better readability for those of you with lots of main categories. This can be greatly expanded to include image dividors, Headings to each of the groups, etc. I have this as a free tip on my site and thought I'd copy and paste the tip for everyone here too.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTE: You should always make a back-up copy of your files and/or database before installing any modification.

This tip will help group categories with a line break, horiziontal rule, image, etc. inbetween category groups.


Look for a section of code in skin1/customer/categories.tpl that looks like this:
Quote:
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
<font class=CategoriesList>{ $categories[cat_num].category_name|escape }</font>

{/section}
{else}

and change it to this:


Quote:
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}

{if $categories[cat_num].order_by eq 50 || $categories[cat_num].order_by eq 100 || $categories[cat_num].order_by eq 150}

{* NOTE: CHANGE THIS
TO BE WHAT EVER YOU WANT TO DIVIDE THE CATEGORIES *}
{/if}

<font class=CategoriesList>{ $categories[cat_num].category_name|escape }</font>

{/section}
{else}

You can change the noted
to a <HR> or an image or anything else you'd like to use to separate your categories.

Example, all the categories in the first grouping have a position number less than say, 50. The next section is between 50-100, next 100-150, etc. This means that the categories you want to show up at the top of the sections will have to have category position, 50, 100, and 150 in this example. You can change the 50, 100, 150 to be what ever position numbers you want and you can add more "or"s to the if statement.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hope this helps some!!

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote