X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   JavaScript Select Box for Categories (https://forum.x-cart.com/showthread.php?t=47038)

Jeremy Smith 04-20-2009 01:38 AM

JavaScript Select Box for Categories
 
Hi there,

I have a major feature enhancement question for some of you template developers of X Cart.

I have made a select box (when I finally get to actually test it due to our web server being annoying at the moment and not allowing me to test it, grrr!). However this only works at present for root categories, havent ventured into the sub categories just wanted to get some advice before I start fiddling with the form I have made.

What I have done is the following:

Quote:

{* $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 ""}
{include file="modules/Fancy_Categories/categories.tpl"}
{assign var="fc_cellpadding" value="0"}
{else}
{if $config.General.root_categories eq "Y"}

<form name="catForm">
<select name="rootCat">

{foreach from=$categories item=c}

<option value="home.php?cat={$c.categoryid}">{$c.category} </option>

<!-- <a href="home.php?cat={$c.categoryid}" >{$c.category}</a> -->

{/foreach}

</select>

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


</form>

{else} {foreach from=$subcategories item=c key=catid}
<a href="home.php?cat={$catid}" >{$c.category}</a><br />
{/foreach}
{/if}
{/if}
{/capture}
{ include file="menuDropDown.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}



Any ideas of how to make the sub categories just either appear, with a 2nd select box to the right of the root categories?

Regards,
Jeremy.

balinor 04-20-2009 03:32 AM

Re: JavaScript Select Box for Categories
 
Be careful, this is very search engine UN-friendly

Jeremy Smith 04-20-2009 03:55 AM

Re: JavaScript Select Box for Categories
 
To be honest, with our main page, thats search engine friendly we have x cart set as a subdomain of our website, so that sort of eradicates that as it where.

We need this as a definate thing in our ecommerce so thats non negotiable, thanks for the comment though.

balinor 04-20-2009 04:05 AM

Re: JavaScript Select Box for Categories
 
Not sure you understand, but if it is non-negotiable I guess it is moot :)

Jeremy Smith 04-20-2009 05:10 AM

Re: JavaScript Select Box for Categories
 
I know but my manager sort of demands it really, sorry.


All times are GMT -8. The time now is 06:58 AM.

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