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)
-   -   Main Categories as a drop down list (https://forum.x-cart.com/showthread.php?t=5297)

natalieb 02-01-2004 10:20 AM

Busy upgrading to 3.5.3, but thanks.
Will test it when I am done :)

anandat 02-21-2004 03:54 AM

Quote:

Originally Posted by amgdg
To select the current category, change your option statement to:

<option class=CategoriesList value="{$categories[cat_num].categoryid}" {if $current_category eq $categories[cat_num]}selected{/if}>{$categories[cat_num].category_name|escape}</option>

-> Al


Strangely this code perfectly on my local pc but when I upload to server
It doesn't select the "curent category" !!! what could be the wrong ?

here is my code
Code:

{* $Id: categories.tpl,v 1.19 2003/11/11 14:02:32 svowl 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"}
<form name="form_cat" method="get" action="home.php">
<select name="cat" onChange="document.form_cat.submit()">
<option value="0">Select...</option>
{section name=cat_num loop=$categories}
<option class=CategoriesList value="{$categories[cat_num].categoryid}" {if $current_category eq $categories[cat_num]}selected{/if}>{$categories[cat_num].category_name|escape}</option>
{/section}
</select>
</form>
{else}
{section name=cat_num loop=$subcategories}
<font class=CategoriesList>{ $subcategories[cat_num].category_name|escape }</font>
 
{/section}
{/if}
{/if}

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


anandat 03-02-2004 04:01 AM

^BUMP^
Any one ?

B00MER 03-02-2004 11:25 PM

Code:

<form name="form_cat" method="get" action="home.php">
<select name="cat" onChange="document.form_cat.submit()">
<option value="0">Select...</option>
{section name=cat_num loop=$categories}
<option class=CategoriesList value="{$categories[cat_num].categoryid}" {if $cat eq $categories[cat_num].categoryid}selected{/if}>{$categories[cat_num].category_name|escape}</option>
{/section}
</select>
</form>


anandat 03-03-2004 12:34 AM

Thanks a lot Boomer...it's working now :)

Here is my code of categories.tpl if one want to use it.
Code:

{* $Id: categories.tpl,v 1.19 2003/11/11 14:02:32 svowl 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"}
<form name="form_cat" method="get" action="home.php">
<select name="cat" onChange="document.form_cat.submit()">
<option value="0">Select...</option>
{section name=cat_num loop=$categories}
<option class=CategoriesList value="{$categories[cat_num].categoryid}" {if $cat eq $categories[cat_num].categoryid}selected{/if}>{$categories[cat_num].category_name|escape}</option>
{/section}
</select>
</form>
{else}
{section name=cat_num loop=$subcategories}
<font class=CategoriesList>{ $subcategories[cat_num].category_name|escape }</font>
 
{/section}
{/if}
{/if}

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


Just one more question this mode is not useful in html catalog as it doesn't generate the HTML links for categories in catalog pages & still generate the .php pages links :( .....is there any way to correct this bug ?

longhorn180 08-27-2004 03:51 PM

I'm using this mod on 3.5.11 and it works perfectly, but I'm developing a store using 4.0.3 and have been unable to get it to work successfully. Does anyone know how to get this working with 4.x.x series because this is a great mod and I would love to continue using it.

plh 09-14-2004 02:08 AM

This mod is working fine. Thanks to Boomer.

I am wondering what it would take to build it to the next level and include the subcategories indented under each of the main categories and separate each main category with a blank line (to make reading this list a little easier on the eyes.)

I am not sure I understand the reason for the HTML build ?? If someone can explain.

Thanks again to "Master" Boomer for its continuing effort in helping others build a better x-cart.

Philippe

Allan Martel 09-16-2004 08:11 AM

When trying this in v4.0.4, the drop down box shows up, but appears to be empty. However, you can click on one of the "BlankSpaces" and you will be taken to the catagory.

Just fails to actually print the catagory name

Any suggestions?

Heres the code I am using:

Code:

{* $Id: categories.tpl,v 1.19 2003/11/11 14:02:32 svowl 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"}
<form name="form_cat" method="get" action="home.php">
<select name="cat" onChange="document.form_cat.submit()">
<option value="0">Select...</option>
{section name=cat_num loop=$categories}
<option class=CategoriesList value="{$categories[cat_num].categoryid}" {if $cat eq $categories[cat_num].categoryid}selected{/if}>{$categories[cat_num].category_name|escape}</option>
{/section}
</select>
</form>
{else}
{section name=cat_num loop=$subcategories}
<font class=CategoriesList>{ $subcategories[cat_num].category_name|escape }</font>
 
{/section}
{/if}
{/if}

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


sabrina 10-10-2004 04:36 PM

<form name="form_cat" method="get" action="home.php">
<td>
<select name="cat" onChange="document.form_cat.submit()">
<option value="0">Select...</option>
{section name=cat_num loop=$categories}
<option class=CategoriesList value="{$categories[cat_num].categoryid}" {if $cat eq $categories[cat_num].categoryid}selected{/if}>{$categories[cat_num].category}</option>
{/section}
</select>
</td>
</form>

PhilJ 10-29-2004 10:52 AM

Category Search Drop Down (v4.x)

Code:

<form name="form_cat" method="get" action="home.php">
    <select name="cat" onChange="document.form_cat.submit()">
      <option value="0" selected>Search By Category</option>
      {section name=cat_num loop=$categories}
      <option value="{$categories[cat_num].categoryid}">{$categories[cat_num].category}</option>
      {/section}
    </select>
</form>


Manufacturer Search Drop Down

Code:

<form name="form_manuf" method="get" action="manufacturers.php">
    <select name="manufacturerid" onChange="document.form_manuf.submit()">
      <option value="0" selected>Search By Manufacturer</option>
      {section name=mid loop=$manufacturers_menu}
      <option value="{$manufacturers_menu[mid].manufacturerid}">{$manufacturers_menu[mid].manufacturer}</option>
      {/section}
    </select>
</form>


Static Pages Drop Down

Code:

<form name="form_info" method="get" action="pages.php">
    <select name="pageid" onChange="document.form_info.submit()">
      <option value="0" selected>Help</option>
                {section name=pg loop=$pages_menu}
      <option value="{$pages_menu[pg].pageid}">{$pages_menu[pg].title}</option>
                {/section}
    </select>
</form>


:wink:


All times are GMT -8. The time now is 09:37 PM.

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