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

Main Categories as a drop down list

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 02-01-2004, 10:20 AM
 
natalieb natalieb is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: The Netherlands, Lelystad
Posts: 42
 

Default

Busy upgrading to 3.5.3, but thanks.
Will test it when I am done
__________________
Regards,

Natalie

Ver. X-cart-gold 4.1.3 [UNIX}
-add on affiliate
Reply With Quote
  #12  
Old 02-21-2004, 03:54 AM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

Default

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}
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote
  #13  
Old 03-02-2004, 04:01 AM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

Default

^BUMP^
Any one ?
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote
  #14  
Old 03-02-2004, 11:25 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

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>
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #15  
Old 03-03-2004, 12:34 AM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

Default

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 ?
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote
  #16  
Old 08-27-2004, 03:51 PM
 
longhorn180 longhorn180 is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Richmond, Virginia
Posts: 187
 

Default

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.
__________________
4.1.9 (Linux) Live Store
www.thecrackedbook.com
Find used books and out of print books.
Reply With Quote
  #17  
Old 09-14-2004, 02:08 AM
 
plh plh is offline
 

Senior Member
  
Join Date: May 2004
Posts: 102
 

Default

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
__________________
X-Cart 4.4.3
- Happily EWD Hosted -
Reply With Quote
  #18  
Old 09-16-2004, 08:11 AM
 
Allan Martel Allan Martel is offline
 

Advanced Member
  
Join Date: Mar 2004
Posts: 72
 

Default

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}
Reply With Quote
  #19  
Old 10-10-2004, 04:36 PM
 
sabrina sabrina is offline
 

Advanced Member
  
Join Date: Feb 2003
Location: Indianapolis, IN., USA
Posts: 53
 

Default

<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>
__________________
X-CART GOLD: 4.0.14

Operating system Linux
Apache version 1.3.33 (Unix)
PERL version 5.8.1
PHP version 4.3.10
MySQL version 4.0.22-standard
Reply With Quote
  #20  
Old 10-29-2004, 10:52 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default

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>

__________________
xcartmods.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 01:28 AM.

   

 
X-Cart forums © 2001-2020