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

category listing help?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-30-2002, 03:39 PM
 
MMB MMB is offline
 

Member
  
Join Date: Nov 2002
Location: Lincoln Park MI
Posts: 17
 

Default 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} &gt; { $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.
Reply With Quote
  #2  
Old 11-30-2002, 06:32 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Make the category only available to a certain membership
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 11-30-2002, 07:56 PM
 
MMB MMB is offline
 

Member
  
Join Date: Nov 2002
Location: Lincoln Park MI
Posts: 17
 

Default

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?
Reply With Quote
  #4  
Old 12-01-2002, 02:57 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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}
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 12-01-2002, 05:09 PM
 
MMB MMB is offline
 

Member
  
Join Date: Nov 2002
Location: Lincoln Park MI
Posts: 17
 

Default

Thank you Thank you!!, That works perfect.
Reply With Quote
  #6  
Old 11-22-2003, 01:28 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

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.
Reply With Quote
  #7  
Old 11-23-2003, 12:50 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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 }
__________________
ex x-cart guru
Reply With Quote
  #8  
Old 11-23-2003, 06:57 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

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.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


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 12:09 AM.

   

 
X-Cart forums © 2001-2020