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)
-   -   main categories drop down list Please help! (https://forum.x-cart.com/showthread.php?t=28977)

sparker2 02-17-2007 07:47 PM

main categories drop down list Please help!
 
PLEASE HELP! Is there a drop down list mod that I can use for my categories that I can create for my main page? My Category list is to long and I am not liking the look. Please help me please. I have been looking all over this forum and I have tried a drop down list that was shared but it will not display my categories. I think it is for an earlier version of x-cart and I have the 4.1.6. Take a look at my site to see what I am talking about. Again please be kind and help me.O:) Thanks in advance.

inebriate 02-17-2007 10:22 PM

Re: main categories drop down list Please help!
 
backup skin1/customer/categories.tpl and replace the inside with

Code:

{capture name=menu}

<form name="formCategories">

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

<select name="listCategories" onchange="window.location=this.options[selectedIndex].value">
<option value=""><font class="VertMenuItems">Select a Category</font></option>
{foreach from=$categories item=c}
<option value="home.php?cat={$c.categoryid}"><font class="VertMenuItems">{$c.category}</font></option>
{/foreach}
</select>

{else} {foreach from=$subcategories item=c key=catid}
<font class="CategoriesList"><a href="home.php?cat={$catid}" class="VertMenuItems">{$c.category}</a></font><br />
{/foreach}
{/if}
{/if}

</form>

{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}


sparker2 02-17-2007 10:51 PM

Re: main categories drop down list Please help!
 
Bless your heart. You have made my weekend. Thank you so much for helping me out.

sparker2 12-27-2010 07:02 PM

Re: main categories drop down list Please help!
 
Inebriate, you showed me how to do this in 2007 with vs 4.1, do you know how to do this category drop down for vs 4.4? It seems the code is very different and the old drop down will not work. This was very helpful in the past. Thank you very much in advance. Shareen

moonslice 05-30-2011 04:40 PM

Re: main categories drop down list Please help!
 
I'd also be interested in how to do drop-down menus in 4.4.x. (and not specifically for categories - products, but rather for the general things a website uses drop-down menus for.)

We had it working on LiteCommerce websites, but can't figure out where to put the couple of javascript codes that are necessary. We thought we had it correct, but it isn't working.

dustinb14 02-18-2013 08:46 AM

Re: main categories drop down list Please help!
 
Looking for this as well .. running 4.5 gold

Marc Gold 12-14-2014 03:04 PM

Re: main categories drop down list Please help!
 
Hi

Did anyone get this sorted for 4.5 or even 4.6. Just started scoping an upgrade of our 4.1 (yeah i know :oops: ).

Any assistance greatly received.

Marc

totaltec 12-14-2014 06:58 PM

Re: main categories drop down list Please help!
 
Okay here goes:
Make sure you are using a custom skin. Don't edit a default skin. Flyout Menus module must be active.

In your custom skin create the file:
modules/Flyout Menus/Icons/fancy_categories.tpl
With this content:
Code:

<div class="nav_menu">
  {if $fancy_use_cache}
    {fancycat_get_cache}
  {else}
    {include file="modules/Flyout_Menus/Icons/fancy_subcategories.tpl" level=0}
  {/if}
  <div class="clearing"></div>
</div>


In your custom skin create the file:
modules/Flyout Menus/Icons/fancy_subcategories.tpl
With this content:
Code:

<ul>
  {foreach from=$categories_menu_list item=c key=catid name=$loop_name}

    <li>
      <a href="home.php?cat={$catid}">
        {$c.category|amp}
      </a>
      {if $c.childs and $c.subcategory_count gt 0}
        {include file="modules/Flyout_Menus/Icons/fancy_subcategories.tpl" categories_menu_list=$c.childs parentid=$catid level=$level+1}
      {/if}
    </li>

  {/foreach}

</ul>

In your custom skin edit or create the file:
customer/head.tpl
Where you want the menu to show up add:
Code:

{include file="modules/Flyout_Menus/Icons/fancy_categories.tpl"}

Add the following CSS to your css/altskin.css:
Code:

#header .line1 .nav_menu {
  height: 40px;
}
.nav_menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav_menu ul > li {
  float: left;
  position: relative;
  text-align: center;
}
.nav_menu ul a:link,
.nav_menu ul a:active,
.nav_menu ul a:visited,
.nav_menu ul a:hover {
  display: block;
  min-width: 120px;
  line-height: 40px;
  background: #ccc none;
  color: #000;
}
.nav_menu ul a:hover {
  background: #222 none;
  color: #fff;
}
.nav_menu ul > li > ul {
  display: none;
  position: absolute;
  top: 40px;
}
.nav_menu ul > li:hover > ul {
  display: block;
  z-index: 10;
}


Position the container and style the menu as needed. This only provides for one level of drop down, the next level can easily be accommodated by adding to the CSS.
Tada!

tony_sologubov 12-16-2014 06:15 AM

Re: main categories drop down list Please help!
 
Mike, you now suggest new files/modules instead of editing core ones for X-Cart 4 changes as well :)
Nicely done!

cflsystems 12-16-2014 06:40 AM

Re: main categories drop down list Please help!
 
You have to remember though when using custom skin and upgrading the cart - all changes to common_files files have to be applied to the custom skin as well. I have seen this when user runs the upgrade and all files are patched by the upgrade script - then they wonder why this or that functionality is not showing....


All times are GMT -8. The time now is 10:56 AM.

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