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

Two Main Category Sections

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 12-28-2006, 08:18 PM
 
justme justme is offline
 

Member
  
Join Date: Jul 2004
Location: Western New York State, USA
Posts: 28
 

Default Two Main Category Sections

Here's how to add a second category box:
Modification is in bold, green, you can copy & paste only this part if your categories.tpl code is different than mine.
This works in versions 3.5 - 4.0.18. I have not tried it in v4.1.xx


In Languages, create (add new entry) two new labels:

variable: lbl_categories1
description: categories 101-199 (edit numbers as needed)
value: (your category name)

variable: lbl_categories2
description: categories 201-299 (edit numbers as needed)
value: (your category name)

Create two new files in the Customer directory (same place you find categories.tpl)

First new file name: categories1.tpl
Paste in the following code. Edit the numbers in bold, red as needed. Save file.

Code:
{* $Id: categories1.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} {if $categories[cat_num].order_by > 100 and $categories[cat_num].order_by < 199} <FONT class="CategoriesList"><A href="home.php?cat={$categories[cat_num].categoryid}" class="VertMenuItems">{$categories[cat_num].category}</A></FONT><BR> {/if} {/section} {else} {section name=cat_num loop=$subcategories} {if $categories[cat_num].order_by > 100 and $categories[cat_num].order_by < 199} <FONT class="CategoriesList"><A href="home.php?cat={$subcategories[cat_num].categoryid}" class="VertMenuItems">{$subcategories[cat_num].category}</A></FONT><BR> {/if} {/section} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories1 menu_content=$smarty.capture.menu }


Second new file name: categories2.tpl
Paste in the following code. Edit the numbers in bold, red as needed. Save file.

Code:
{* $Id: categories2.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} {if $categories[cat_num].order_by > 200 and $categories[cat_num].order_by < 299} <FONT class="CategoriesList"><A href="home.php?cat={$categories[cat_num].categoryid}" class="VertMenuItems">{$categories[cat_num].category}</A></FONT><BR> {/if} {/section} {else} {section name=cat_num loop=$subcategories} {if $categories[cat_num].order_by > 200 and $categories[cat_num].order_by < 299} <FONT class="CategoriesList"><A href="home.php?cat={$subcategories[cat_num].categoryid}" class="VertMenuItems">{$subcategories[cat_num].category}</A></FONT><BR> {/if} {/section} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories2 menu_content=$smarty.capture.menu }

In customer/home.tpl

REPLACE (or comment out)
Code:
{ include file="customer/categories.tpl" }
with the following:

Code:
{ include file="customer/categories1.tpl" } { include file="customer/categories2.tpl" }
Set the Category Position (POS) so each category shows up in the appropriate category box. Example: categories1.tpl calls for categories numbered from (POS) 100 to 199. " {if $categories[cat_num].order_by > 100 and $categories[cat_num].order_by < 199} "


Note: To add more category boxes, you also need to edit the category name (in bold) in two places in each new template(s) you create.

Code:
{* $Id: categories2.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} >> >> { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories2menu_content=$smarty.capture.menu }



JustMe
Reply With Quote
  #2  
Old 12-29-2006, 05:22 AM
 
sohaibkhan sohaibkhan is offline
 

Advanced Member
  
Join Date: Apr 2006
Posts: 78
 

Default Re: Two Main Category Sections

Hello, I have added the categories boxes but no content is showing up. It was just giving me the heading but there is no links no products I already have sub categories I dont know if they are going to show in those boxes or what is going to happend.

Please let me know
__________________
Current version: 4.1.5 Centos 4x
Reply With Quote
  #3  
Old 12-30-2006, 06:08 AM
 
AllNatural AllNatural is offline
 

Newbie
  
Join Date: Sep 2006
Posts: 5
 

Default Re: Two Main Category Sections

I just installed this mod too, but got the same problem as sohaibkhan; the headings are showing, but no content... (version 4.1.3)
__________________
version 4.1.9
Reply With Quote
  #4  
Old 01-04-2007, 07:47 PM
  RJC's Avatar 
RJC RJC is offline
 

Advanced Member
  
Join Date: Nov 2003
Posts: 57
 

Default Re: Two Main Category Sections

Quote:
Originally Posted by AllNatural
I just installed this mod too, but got the same problem as sohaibkhan; the headings are showing, but no content... (version 4.1.3)

justme said they didn't try it on 4.1 yet..and apparently it doesn't work (I'm having the same issue)..

Anyone figure it out yet?
__________________
Business 5.3.5.4
Reply With Quote
  #5  
Old 01-10-2007, 02:31 PM
 
ikordesign ikordesign is offline
 

Newbie
  
Join Date: Aug 2004
Posts: 2
 

Default Re: Two Main Category Sections

I have the 4.1.3 version and im getting the same problem like: AllNatural and
sohaibkhan.

Any suggestions please!!!
__________________
...
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:49 PM.

   

 
X-Cart forums © 2001-2020