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)
-   -   Subcategories Listing help! (https://forum.x-cart.com/showthread.php?t=884)

ciava 12-05-2002 07:45 AM

Subcategories Listing help!
 
Im currently trying to implement a shop by brand section in a drop down menu.



Code:

<FORM action="home.php" method=GET name=cat_form>
<SELECT name=cat onChange="javascript: document.cat_form.submit()">
{section name=cat_num loop=$subcategories}
<OPTION value="{$subcategories[cat_num].categoryid}"{if $subcategories eq $subcategories[cat_num].categoryid} selected{/if}>{$subcategories[cat_num].category}</OPTION>
{/section}
</SELECT>
</FORM>


but the above once into a category it will then list the subcategories, but i just want the subcategories to be displayed under the specific cat.
what I require is for the main cat i created (ie. shop by brand) just to display the its subcategories subcategories

I have tried to include a if statement

Quote:

{if $config.general.root_categories eq "351" loop=$subcategories}
in the form
but that just gives me a smarty php error of an unexpected $


any help would be grateful.

many thaks
Anton
http://www.savatrader.com/xcart/customer/home.php

funkydunk 03-17-2003 07:50 AM

Need to separate the two bits:

{if $config.general.root_categories eq "351"}
{section=sub_cat loop=$subcategories}
Your loopy bits
{/section}
{/if}

I know this is previous cos you have drop downs on your site now - but as these were hardcoded this might help.

:D


All times are GMT -8. The time now is 01:30 AM.

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