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)

shwekhaw 11-26-2004 04:57 PM

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

Ryano 01-07-2005 12:21 PM

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!

Khar 02-06-2005 03:59 PM

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>


:wink:


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

PhilJ 02-07-2005 02:52 AM

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" }

Khar 02-08-2005 01:42 PM

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

Khar 03-06-2005 11:54 AM

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.

x-online 03-06-2005 04:40 PM

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!!

=D>=D>=D>=D>=D>=D>=D>=D> for PhilJ!!

Khar 03-06-2005 05:13 PM

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

x-online 03-06-2005 05:52 PM

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.

Khar 03-07-2005 01:06 PM

thanks I'll start searching


All times are GMT -8. The time now is 03:41 AM.

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