X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Two Main Category Sections (https://forum.x-cart.com/showthread.php?t=27653)

justme 12-28-2006 08:18 PM

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

sohaibkhan 12-29-2006 05:22 AM

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

AllNatural 12-30-2006 06:08 AM

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)

RJC 01-04-2007 07:47 PM

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?

ikordesign 01-10-2007 02:31 PM

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


All times are GMT -8. The time now is 05:20 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.