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)

shealey 06-15-2005 05:22 AM

does anyone know how to get the drop down menu to sit inside the say Manufacturers box? Ive asked this a while ago in this thread but no responses as yet?? See www.supplementzone.com.au
thanks so much!!

magnifold 06-16-2005 10:47 AM

Quote:

Originally Posted by shealey
does anyone know how to get the drop down menu to sit inside the say Manufacturers box? Ive asked this a while ago in this thread but no responses as yet?? See www.supplementzone.com.au
thanks so much!!


I'm usig x-cart gold 4.0.13 and ths script works fine.

Code:

{* $Id: menu_manufacturers.tpl,v 1.4 2004/06/22 05:38:52 max Exp $ *}
{if $manufacturers_menu ne ''}
{capture name=menu}
<FORM NAME="formManufacturer">
<SELECT NAME="listManufacturer" onchange="window.location=this.options[selectedIndex].value">
<OPTION VALUE="">- select -</OPTION>
{section name=mid loop=$manufacturers_menu}
<OPTION VALUE="manufacturers.php?manufacturerid={$manufacturers_menu[mid].manufacturerid}"><font  class="VertMenuItems">{$manufacturers_menu[mid].manufacturer}</font></OPTION>
{/section}
</SELECT>
</FORM>
{if $show_other_manufacturers}


{$lng.lbl_other_manufacturers}

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


{/if}


Just replace everything in /modules/Manufacturers/menu_manufacturers.tpl with the above code and make sure to make a backup copy of the original file just in case you need to revert.

B00MER 08-01-2005 01:23 PM

Quote:

Originally Posted by magnifold
I'm usig x-cart gold 4.0.13 and ths script works fine.


Defiantly an improvement than the default menu list, but I wanted all of the mfr's listed and the other mfr. link removed. I also truncated long mfr names to keep the drop down menu small.

kudos!
Code:

{if $manufacturers_menu ne ''}
{capture name=menu}
<FORM NAME="formManufacturer">
<SELECT NAME="listManufacturer" onchange="window.location=this.options[selectedIndex].value">
<OPTION VALUE="">Select Mfr.</OPTION>
{section name=mid loop=$manufacturers}
{if $manufacturers[mid].manufacturerid ne 0}
<OPTION VALUE="manufacturers.php?manufacturerid={$manufacturers[mid].manufacturerid}"><font class="VertMenuItems">{$manufacturers[mid].manufacturer|truncate:25:"..."}</font></OPTION>
{/if}
{/section}
</SELECT>
</FORM>
{*if $show_other_manufacturers}

 
{$lng.lbl_other_manufacturers}
 
{/if*}
{/capture}
{include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_manufacturers menu_content=$smarty.capture.menu}

 
{/if}


donavichi 09-10-2005 08:28 AM

anyone managed to do a drop-down search for the subcategories?

idesign123 09-28-2005 03:00 AM

Bug?
 
I'm using the code listed two posts before mine (Boomer).

There seems to be a minor bug though...

- Go to http://www.southernhotrod.com/store/
You will see manufacturers in a dropdown. Works Great.

- Now click on "About Us" (top menu).
The manufacturers menu is now blank.

* the manufacturers menu is blank on all pages in the 'help' section.

Can someone please suggest a fix?

:Stacey

B00MER 09-28-2005 06:19 AM

Try changing any instance: $manufacturers to $manufacturers_menu

idesign123 09-28-2005 11:53 AM

That did the trick :D

Thanks Boomer!

superfish 10-25-2005 02:58 PM

Quote:

Originally Posted by PhilJ
Category Search Drop Down (v4.x)

This is great - any chance there's a way to manipulate this so it shows all of the manufacturers/products in the drop down but the standard 10/20 categories beneath it?

I've already combined the two into my menus so the drop down appears above the links. Just looking for that little added bonus. :)

QVS 05-11-2006 04:58 AM

Quote:

Originally Posted by donavichi
anyone managed to do a drop-down search for the subcategories?


yeh im after getting the full list all catagories, not just the main ones. any ideas on what to change on the code?

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>


marcelox7 06-29-2006 11:55 AM

Manufacturers menu drop down! By Marcelo
 
X-cart 4.1.1
1. Create manufactures.tpl in skin1/customer (blank file)

2. Now drop this code:

{* $Id: menu_manufacturers.tpl,v 1.5 2005/11/17 06:55:47 max Exp $ *}
{if $manufacturers_menu ne ''}
{capture name=menu}
<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>
{*if $show_other_manufacturers}


{$lng.lbl_other_manufacturers}

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


{/if}

3. Save

4. In the skin1/customer/home.tpl change this line:

{ include file="modules/Manufacturers/menu_manufacturers.tpl" }
for this one
{ include file="customer/manufacturers.tpl" }

5. Done (works with php and html catalog)

CompulsiveHp 06-29-2006 04:29 PM

NM, I figured it out.

Amy 07-13-2006 08:21 AM

Quote:

Originally Posted by CompulsiveHp
NM, I figured it out.


well, what did you do????

NightFire 09-08-2006 01:52 PM

Re: Main Categories as a drop down list
 
An very old tread, but I tried to use the code. But I was only able to show the 10 manufactures. If I remove the manufactures_menu --> manufactures it shows the list. But when you go to the contact page for example. There is no list.
Anyone got an working code?

donavichi 09-08-2006 03:05 PM

Re: Main Categories as a drop down list
 
Go to General Settings > Modules Options and (about 5th from bottom) change the 'Manufacturers list limit:' from 10 to whatever number of manufacturers you want the list to show.
Re-implement the mod and it should work fine

NightFire 09-08-2006 10:08 PM

Re: Main Categories as a drop down list
 
Quote:

Originally Posted by donavichi
Go to General Settings > Modules Options and (about 5th from bottom) change the 'Manufacturers list limit:' from 10 to whatever number of manufacturers you want the list to show.
Re-implement the mod and it should work fine


Thanks, totally overlooked that option. Works great now.

mdperfumes 09-23-2006 06:36 PM

Re: Main Categories as a drop down list
 
has anyone done this for 4.1.3?

sparker2 02-17-2007 11:17 AM

Re: Main Categories as a drop down list
 
Guys, please help me. I cannot get this drop down menu to display my categories at all. What am I doing wrong? Does this work for version 4.1.6

gopinath 10-09-2007 06:43 AM

Re: Main Categories as a drop down list
 
Could anyone help how to get categories list as drop down menu. i have some of the posts but i couldn't find..

Thanks
Xcart version 4.1.8

gopinath 10-09-2007 06:45 AM

Re: Main Categories as a drop down list
 
Hi

Could anyone help how to get categories list as drop down menu. i have seen some of the posts but i couldn't find..

Thanks
Xcart version 4.1.8

RPRESTEL 07-29-2009 06:33 PM

Re: Main Categories as a drop down list
 
Odd request here. I may have overlooked it so slap me if I did.

Since we have about 250 mfg's I wanted to put them in a dropdown list. However, we want to display the names of our top 25 manufacturers above the drop down list. I want all of the mfg's to display in the drop down. We have tuned our admin module to display 25.

Essentially I want the best of both worlds, however I am unable to get the list to display everything. Is there a quick fix for this?

Jeremy Smith 09-14-2011 08:10 AM

Re: Main Categories as a drop down list
 
This is mainly for my own notes but I thought I would share this with you.

Here's some smarty logic to show you that works on the basis that if you don't select a root category, then the sub categories are disabled from being selected.

HTML Code:

{* $Id: categories.tpl,v 1.26.2.4 2008/07/22 07:58:28 ferz Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{assign var="fc_cellpadding" value="0"}
{else}
{if $config.General.root_categories eq "Y"}


<form name="catForm">Manufacturer:
<select name="rootCat" onChange="window.location=document.catForm.rootCat.options[document.catForm.rootCat.selectedIndex].value">



<option value="">Please select: </option>

{foreach from=$categories item=c}

{if $current_category.parentid lt "0"}
<option value="home.php?cat={$c.categoryid}">{$c.category}</option>
{elseif $current_category.parentid eq "0"}
<option value="home.php?cat={$c.categoryid}" {if $current_category.categoryid eq $c.categoryid} selected {/if}>{$c.category}</option>
{else}
<option value="home.php?cat={$c.categoryid}" {if $current_category.parentid eq $c.categoryid} selected {/if}>{$c.category}</option>
{/if}

{/foreach}

</select>

Model:
{if $current_category.parentid lt "0"}

  <select id="subCat" name="subCat" disabled>
    <option value=""></option>
  </select>
{else}
  <select id="subCat" name="subCat">
    <option value="#">Please select</option>
    {foreach from=$subcategories item=c key=catid}
    <option value="home.php?cat={$catid}">{$c.category}</option>
    {/foreach}
  </select>
{/if}

<input type="button" name="go" value="Select" onClick="window.location=document.catForm.subCat.options[document.catForm.subCat.selectedIndex].value">

</form>

{else}

{/if}
{/if}
{/capture}
{ include file="menuDropDown.tpl" menu_content=$smarty.capture.menu }
</div>
<div id="printerSearchBottom"></div>


But I have a problem, what if anyone wanted to select another printer model?

I mean at the moment when you go into a sub category on our site you can not then go into another sub category for that root category if that makes any sense?

Let me explain this a bit better, say I wanted to buy a Brother printer A's cartridges but then I would not see Printer B's cartridges as I have that printer also, I would then find that annoying and go to another site, if you're with me?

If there anyway of still showing all subcategories within a given root?

But also I wanted to be able to disable the select button based on if a sub category has been selected is there anyway of doing this or at least when a root category has been selected?

Bearing in mind we are using v4.1.11 here, any replies is much appreciated and hope this helps some people

Really all you do is look at your HTML source and your smarty tags output and compare them together if they equal each other the category id then show selected in the options value, if they don't then don't it's that simple.

See I tried this one here:

HTML Code:

<a href="#" target="_blank" title="" class="noborder"><img src="/skin1/images/eCommsStoreLocator.gif" border="0" style="margin-bottom:10px;"/></a>
<div id="printerSearchTop"><h2>Printer Search</h2></div>
<div id="printerSearchMiddle">
{* $Id: categories.tpl,v 1.26.2.4 2008/07/22 07:58:28 ferz Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{assign var="fc_cellpadding" value="0"}
{else}
{if $config.General.root_categories eq "Y"}


<form name="catForm">Manufacturer:
<select name="rootCat" onChange="window.location=document.catForm.rootCat.options[document.catForm.rootCat.selectedIndex].value">



<option value="">Please select: </option>

{foreach from=$categories item=c}

{if $current_category.parentid lt "0"}
<option value="home.php?cat={$c.categoryid}">{$c.category}</option>
{elseif $current_category.parentid eq "0"}
<option value="home.php?cat={$c.categoryid}" {if $current_category.categoryid eq $c.categoryid} selected {/if}>{$c.category}</option>
{else}
<option value="home.php?cat={$c.categoryid}" {if $current_category.parentid eq $c.categoryid} selected {/if}>{$c.category}</option>
{/if}

{/foreach}

</select>

Model:
{if $current_category.parentid lt "0"}

  <select id="subCat" name="subCat" disabled>
    <option value=""></option>
  </select>
{else}
  <select id="subCat" name="subCat">
    <option value="#">Please select</option>
    {foreach from=$subcategories item=c key=catid}
    <option value="home.php?cat={$catid}">{$c.category}</option>
    {/foreach}
  </select>
{/if}

{if $current_category.parentid gt "0"}

<input type="button" name="go" value="Select" onClick="window.location=document.catForm.subCat.options[document.catForm.subCat.selectedIndex].value">
{else}
<input type="button" name="go" value="Select" onClick="window.location=document.catForm.subCat.options[document.catForm.subCat.selectedIndex].value" disabled>
{/if}

</form>

{else}

{/if}
{/if}
{/capture}
{ include file="menuDropDown.tpl" menu_content=$smarty.capture.menu }
</div>
<div id="printerSearchBottom"></div>


But as soon as it gets to this point here:
HTML Code:

{if $current_category.parentid gt "0"}

<input type="button" name="go" value="Select"  onClick="window.location=document.catForm.subCat.options[document.catForm.subCat.selectedIndex].value">
{else}
<input type="button" name="go" value="Select"  onClick="window.location=document.catForm.subCat.options[document.catForm.subCat.selectedIndex].value"  disabled>
{/if}


It still disables the submit button, any help's appreciated,
Jeremy.


All times are GMT -8. The time now is 04:41 PM.

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