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
  #21  
Old 11-26-2004, 04:57 PM
 
shwekhaw shwekhaw is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 148
 

Default

I really like this dropdown catagory boxes. Ideal navigation menu for the site I am working on. The site will have main catagories and subcatagories as follows:
> Manufacturer names (HP, Canon, etc...) as main catagories.
> Product Model as sub catagories

But I want to automate a little. When user choose a main catagory, in this case manufacturer name, I like second dropdown box shows only sub catagories under that manufacturer. I know how to do in regular html coding but I have no experience in php coding or whatever X-cart uses.

I tried PhilJ's code and it works for one drop down box. But I need atleast two level dropdown and possible three level in future.

S-H-W-E-K-H-A-W
__________________
X-Cart Gold Plus 4.5.5
Checkout ONE
Checkout ONE DPM
BCSE CIM
Apache
Linux
Reply With Quote
  #22  
Old 01-07-2005, 12:21 PM
 
Ryano Ryano is offline
 

Senior Member
  
Join Date: Jun 2004
Posts: 192
 

Default

Anyone have any samples of what this looks like? I am using version 3.58 and I have many categories listed on the side. However, I would like only some of them to be put in a drop down box above them so that my site will look cleaner and not have so many categories taking up space. I am guessing that if I do this mod, that ALL of my categories will end up in the drop down box? Anyone have a code for me to only have some of the cats in a dropdown? Thanks a lot!
__________________
xcart v3.5.8 (Unix)
and
xcart v4.0.13
Reply With Quote
  #23  
Old 02-06-2005, 03:59 PM
 
Khar Khar is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 57
 

Default

Quote:
Originally Posted by PhilJ
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>


I would love to use this mod for just my manufacturers menu. In what .tpl would I place this code
__________________
tekmind

X-cart 4.0.7 [unix]
Reply With Quote
  #24  
Old 02-07-2005, 02:52 AM
 
PhilJ PhilJ is offline
 

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

Default

Quote:
In what .tpl would I place this code

skin1/customer/home.tpl

copy the code to a new file - skin1/customer/manufacturers.tpl

replace the code

Code:
{ include file="modules/Manufacturers/menu_manufacturers.tpl" }

with

Code:
{ include file="customer/manufacturers.tpl" }
__________________
xcartmods.co.uk
Reply With Quote
  #25  
Old 02-08-2005, 01:42 PM
 
Khar Khar is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 57
 

Default

Thanks for getting back to me. I just got it working and it's just what I wanted.
__________________
tekmind

X-cart 4.0.7 [unix]
Reply With Quote
  #26  
Old 03-06-2005, 11:54 AM
 
Khar Khar is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 57
 

Default

I'm having an issue with the number of manufacturers that are sowing up in the drop down menu.
It will only display ten manufacturers. If I deactivate one in the admin area a new one shows up in its place on the customer front end menu. I have twelve manufacturers in the admin area. I only get ten in the customer front end.

I not sure what is going on.
__________________
tekmind

X-cart 4.0.7 [unix]
Reply With Quote
  #27  
Old 03-06-2005, 04:40 PM
 
x-online x-online is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Australia, Sydney
Posts: 189
 

Default

Quote:
Originally Posted by PhilJ
Quote:
In what .tpl would I place this code
skin1/customer/home.tpl
copy the code to a new file - skin1/customer/manufacturers.tpl
replace the code
Code:
{ include file="modules/Manufacturers/menu_manufacturers.tpl" }
with
Code:
{ include file="customer/manufacturers.tpl" }

*** Just wanted to alter PhilJ's words abit but with alot appreciated to you for creating this code tho!! Thanks! ***

I was abit confused when i read his comment.

For manufacturers only!!!
Basicly, you created "manufacturers.tpl" and drop it in "skin1/customer/"
Copy this code below in manufacturers.tpl:
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>
In "skin1/customer/home.tpl":
find:
Code:
{ include file="modules/Manufacturers/menu_manufacturers.tpl" }

replace with
Code:
{ include file="customer/manufacturers.tpl" }

reload your homepage!!! Tada!!

for PhilJ!!
__________________
X-Cart version 4.x (Most likely will be the latest version)
Reply With Quote
  #28  
Old 03-06-2005, 05:13 PM
 
Khar Khar is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 57
 

Default

x-online I believe you have misunderstood me. I do however appreciate your help.

The mod works. I was able to to get the mod up and running. The problem is it only displays the first ten manufacturers in the drop down and I have double that.


Thank You
x-online and of-course PhilJ
__________________
tekmind

X-cart 4.0.7 [unix]
Reply With Quote
  #29  
Old 03-06-2005, 05:52 PM
 
x-online x-online is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Australia, Sydney
Posts: 189
 

Default

Khar,

I honestly didn't ready your post before about limited up to 10 manufacturers. Also, i only focused on the codes that philJ was given.

Wheni first read his commend i was hum...
open home.tpl... copied everything to manufactorys.tpl??!!??
then what?.. replaced code in manufactory.tpl??!!??

I just clear things up.. just incase if someone else stupid like me when first read it :P

Anyhow, back to your problem.. i have seen the solution somewhere before int he forum..
Please do a search i am pretty sure that i have seen it before.

Will keep you up to date if i came across again.
__________________
X-Cart version 4.x (Most likely will be the latest version)
Reply With Quote
  #30  
Old 03-07-2005, 01:06 PM
 
Khar Khar is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 57
 

Default

thanks I'll start searching
__________________
tekmind

X-cart 4.0.7 [unix]
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 12:15 AM.

   

 
X-Cart forums © 2001-2020