X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   category listing help? (https://forum.x-cart.com/showthread.php?t=832)

MMB 11-30-2002 03:39 PM

category listing help?
 
is it possible to have my catagory listing list all catagories except for one of them? I would like to put one catagory link in a different part of the website and not be shown on the catagory list.

the catagory id is 3, how can i wright the loop to not include this catagory? I have the cart enabled to use the first loop.

here is the code from my customer/categories.tpl

Code:


{if $config.General.root_categories eq "Y"}

{section name=cat_num loop=$categories}
> { $categories[cat_num].category|escape }

{/section}


{else}

{section name=cat_num loop=$subcategories}
<font class=CategoriesList>{ $subcategories[cat_num].category|escape }</font>

{/section}

{/if}



Sorry if this is a very basic question, but i have only been playing with php and smarty for 2 weeks.

Thanks in advance for your reply.

B00MER 11-30-2002 06:32 PM

Make the category only available to a certain membership ;)

MMB 11-30-2002 07:56 PM

Thanks BOOMER, but I still want all memberships to be able to view this catagory, If it helps i am making a section for manufactures list, with a drop down box of the manufactures, i do not want "manufactures list" included in the main menu of catagories?

is that possible, or do i just need to take the loop out and write my own links there?

funkydunk 12-01-2002 02:57 AM

Hi,

Simply need to put in an if statement at the begginning that rules out a certain category. In this example it rules out category 8.

Code:

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

{if $categories[cat_num].categoryid eq 8}
{else}

{ $categories[cat_num].category|escape }

{/section}
{else} {section name=cat_num loop=$subcategories}
{ $subcategories[cat_num].category|escape }

{/if}

{/section}
{/if}


MMB 12-01-2002 05:09 PM

Thank you Thank you!!, That works perfect.

adpboss 11-22-2003 01:28 PM

Using 3.4.9 could really use a hand with this.

Can't seem to make the code above work. I keep getting smarty errors in the store. Rather than showing you every dumb combination I have tried and failed with, could someone mark up my code and give me a point in the right direction?

I really need to break up my categories.

Code:

{* $Id: categories.tpl,v 1.18 2003/02/25 08:58:46 olga Exp $ *}
{capture name=menu}
{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} {section name=cat_num loop=$subcategories}
<font class=CategoriesList>{ $subcategories[cat_num].category_name|escape }</font>

{/section}
{/if}


{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }


TIA.

funkydunk 11-23-2003 12:50 AM

Try:

Code:

{* $Id: categories.tpl,v 1.18 2003/02/25 08:58:46 olga Exp $ *}
{capture name=menu}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}

{if $categories[cat_num].categoryid eq 8}
{* do this *}
{else}

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

{/section}
{else} {section name=cat_num loop=$subcategories}
<font class=CategoriesList>{ $subcategories[cat_num].category_name|escape }</font>
 
{/section}
{/if}

 
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }


adpboss 11-23-2003 06:57 AM

FD,

Thank you so much. It works like a dream. Any idea how to take out multiple categories?

I tried a few different combos and we were back to errors again.

I think I should be combining them in this statement

Code:

{if $categories[cat_num].categoryid eq 8}
but I just can't seem to get this right.


All times are GMT -8. The time now is 03:34 AM.

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