Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Grouping Categories for better viewing

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #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,063
 

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
  #2  
Old 01-16-2005, 09:40 PM
 
skyking skyking is offline
 

Member
  
Join Date: Mar 2004
Posts: 13
 

Default

You do good work!
This is just what I was looking for on a new project, thank you much.
__________________
X-Cart gold 4.1.9
Reply With Quote
  #3  
Old 01-31-2005, 07:32 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

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

Default

I have finally implemented this on my site. So you can see an example of what you can do with this simple mod there. (http://www.bcsengineering.com/store/catalog)

Here's the exact code for on my site (notice the part set off in the middle is the new part):

Code:
if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} {if $categories[cat_num].order_by eq 0} {$lng.lbl_heading1} {elseif $categories[cat_num].order_by eq 80} {$lng.lbl_heading2} {elseif $categories[cat_num].order_by eq 90} {$lng.lbl_heading3} {elseif $categories[cat_num].order_by eq 150} {$lng.lbl_heading4} {/if} <font class=CategoriesList>{$categories[cat_num].category_name}</font> {/section}

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
  #4  
Old 02-01-2005, 06:36 PM
 
Khar Khar is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 57
 

Default

How did you center your headings??
__________________
tekmind

X-cart 4.0.7 [unix]
Reply With Quote
  #5  
Old 02-01-2005, 06:47 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

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

Default

Khar,

Here's an example lable for my site:
lbl_heading1 is:
Quote:
<center>X-cart Mods</center>

Does that help? I left the full control to be in the heading lable.

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
  #6  
Old 02-01-2005, 07:00 PM
 
Khar Khar is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 57
 

Default

Perfect!!!

Thanks again.
__________________
tekmind

X-cart 4.0.7 [unix]
Reply With Quote
  #7  
Old 02-01-2005, 08:29 PM
  rjcbear's Avatar 
rjcbear rjcbear is offline
 

X-Adept
  
Join Date: Jun 2004
Location: Alabama,U.S.A
Posts: 503
 

Default

YEAH!!!! Carrie. Big time Kuddos for you.

Thank you so much
__________________
X-CART Gold version 4.0.14 & 4.1.11
Apache Version 1.3.29 (Unix)
EWDHosting-Quality X-cart Hosting
We will always sell you the right shoe and the left one is free.
Reply With Quote
  #8  
Old 03-10-2005, 06:46 AM
 
Freakmode Freakmode is offline
 

X-Adept
  
Join Date: Jun 2003
Location: UK
Posts: 696
 

Default

Hi

I tried this for 4.012 and it just shows nothing in the categories box.

I have checked that I have the cats numbered corectly but no joy.

Is it different on 4.012 or should it work?
__________________
X-Cart 4.7.12 (Live)
Redux Template
CDSEO
Reply With Quote
  #9  
Old 03-10-2005, 06:55 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

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

Default

Can you post the code you changed?

Thanks,

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
  #10  
Old 04-18-2005, 11:59 PM
 
WPOO WPOO is offline
 

Advanced Member
  
Join Date: May 2004
Location: Delft - Netherlands -
Posts: 31
 

Default Will this work for products aswell?

I would like to have this work with products as well.

Example:

Memory -> PC266
PC333
PC400

I would like to list all PC266 memory first then the PC333 and then the PC400

Is there a way to do this?

Regards WP
__________________
X-Cart Gold 4.13
X-Configurator
X-ROM
Easy Checkout
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:46 PM.

   

 
X-Cart forums © 2001-2020