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
  #1  
Old 11-22-2003, 01:34 AM
 
issay issay is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 59
 

Default Main Categories as a drop down list

I couldn't find a post dealing with this.
By default, main categories are listed showing all categories either on the right or left side of the page. What I would like to do is show all main categories as a drop down list. Selecting a category will take the user to the respective subcategories page as happens now. This must be quite simple, I guess....
Reply With Quote
  #2  
Old 11-22-2003, 05:35 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

try this one

http://forum.x-cart.com/viewtopic.php?t=4248&highlight=
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 11-22-2003, 06:43 AM
 
issay issay is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 59
 

Default

not exactly what I am looking for.

Here is a drawing of how I want it to appear...

http://www.shopping.com.mv/mall/images/images2/cat.GIF
Reply With Quote
  #4  
Old 11-24-2003, 07:34 AM
 
issay issay is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 59
 

Default

I am sure this is quite simple to do ... Waiting for someone to save the day...
Reply With Quote
  #5  
Old 11-25-2003, 01:52 AM
 
chycor chycor is offline
 

Advanced Member
  
Join Date: Feb 2003
Location: Cornwall, UK
Posts: 53
 

Default

Hi there,

We have done this already.

Backup /skin1/customer/categories.tpl

Old 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"} {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} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }

Replace with this - New 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}">{$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}

This for 3.5.0. May be incompatible with 3.4.x series.

Always back up first!!!!!
Reply With Quote
  #6  
Old 11-25-2003, 01:55 AM
 
chycor chycor is offline
 

Advanced Member
  
Join Date: Feb 2003
Location: Cornwall, UK
Posts: 53
 

Default

Could a moderator move this thread to "custom mods" for the benefit of other xcart users.
Reply With Quote
  #7  
Old 11-25-2003, 07:20 AM
 
issay issay is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 59
 

Default

Thanks a lot for this mod... I was able to get it working on 3.4 with some minor modifications....
One question though: How can we make the selected category be shown in the drop down list even if we browse thorugh the subcategories... Now, when we select a subcategory the option select shown gets reset to "Select a category...."?
Reply With Quote
  #8  
Old 01-22-2004, 10:17 PM
 
amgdg amgdg is offline
 

Newbie
  
Join Date: Jan 2004
Location: Idaho
Posts: 4
 

Default

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
Reply With Quote
  #9  
Old 01-23-2004, 11:10 PM
 
natalieb natalieb is offline
 

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

Default MOD possible also for just 1 category?

Great MOD!
Is it possible to have this MOD on just 1 category.
I have setup categories for different products and 1 which is the main, this is the "Shop by brand".
What would I need to change in this MOD to have it just for the shop by brand category so the customer is taken right to the selected brand page with subcategories?
Thanks for any input.
__________________
Regards,

Natalie

Ver. X-cart-gold 4.1.3 [UNIX}
-add on affiliate
Reply With Quote
  #10  
Old 01-23-2004, 11: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

Inside the {section} loop use
Code:
{if $cateogires[cat_num].categoryid eq "55"} Regular Cat {else} Dropdown Cat {/if}
In order to have a single category branch in the dropdown you'll need to modify include/categories.php
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


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 04:41 AM.

   

 
X-Cart forums © 2001-2020