Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

JavaScript Select Box for Categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-20-2009, 01:38 AM
 
Jeremy Smith Jeremy Smith is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 167
 

Exclamation 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.
__________________
Version 4.1.11 on Linux (Fedora)
X-Cart Gold
Reply With Quote
  #2  
Old 04-20-2009, 03:32 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: JavaScript Select Box for Categories

Be careful, this is very search engine UN-friendly
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 04-20-2009, 03:55 AM
 
Jeremy Smith Jeremy Smith is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 167
 

Default 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.
__________________
Version 4.1.11 on Linux (Fedora)
X-Cart Gold
Reply With Quote
  #4  
Old 04-20-2009, 04:05 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: JavaScript Select Box for Categories

Not sure you understand, but if it is non-negotiable I guess it is moot
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 04-20-2009, 05:10 AM
 
Jeremy Smith Jeremy Smith is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 167
 

Default Re: JavaScript Select Box for Categories

I know but my manager sort of demands it really, sorry.
__________________
Version 4.1.11 on Linux (Fedora)
X-Cart Gold
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 07:28 AM.

   

 
X-Cart forums © 2001-2020