Jump to content

Recommended Posts

@Tsimi

ok, thank you for the explanation. As I mentioned, nothing seems to be off with menu display or functionality without those attributes. So, I think I will continue with them removed. Thanks again.

 


osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Share this post


Link to post
Share on other sites

This module was incorporated into Bootstrap v2.3.4.1 CE. 

I'm just looking for a horizontal menu without the dropdown for one particular site.  

I know it seems to contradict what this module is about - but can I disable the dropdown element?   My attempts haven't quite worked as they should. 

Or is there another horizontal menu module that works with Bootstrap, that doesn't have the dropdown element built in? 

many thanks

Share this post


Link to post
Share on other sites

@Rosyweb

Hi Ros

You mean you just want to have the parent categories inside the menu without the sub-categories dropdown function right?
If yes then do the following changes inside the classes/catmenu.php file

FIND (around line 44)
 

		  if (isset($this->_data[$category_id]) && ($level != 0)) {
            $result .= '<li class="dropdown dropdown-submenu"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">';
            $caret = '';
          } elseif(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
            $result .= $this->root_start_string;
            $result .= '<a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">';
            $caret =   ' <span class="fas fa-caret-down"></span>';
            			
          } else {
            $result .= $this->child_start_string;
            $result .= '<a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">';           
            $caret = false;
          }

REPLACE WITH
 

		/*  if (isset($this->_data[$category_id]) && ($level != 0)) {
            $result .= '<li class="dropdown dropdown-submenu"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">';
            $caret = '';
          } elseif(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
            $result .= $this->root_start_string;
            $result .= '<a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">';
            $caret =   ' <span class="fas fa-caret-down"></span>';
            			
          } else {*/
            $result .= $this->child_start_string;
            $result .= '<a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">';           
            $caret = false;
        //  }

Now you should only see the parent categories without any dropdown feature. The show image function still works if needed.
If you use this together with the XS menu, which you shouldn't if you only use parent categories, then you'll have to add the following changes to the classes/catmenu_xs.php file.

FIND
 

		  if (isset($this->_data[$category_id]) && ($level != 0)) {
// HAS MORE SUBCATEGORIES			  
            $result .= '<li><a href="#">';	   
          } elseif(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
// PARENT HAS CHILD CATEGORIES			  
            $result .= $this->root_start_string;
            $result .= '<a href="#">';          			
          } else {
// NO SUBCATEGORIES			  
            $result .= $this->child_start_string;
            $result .= '<a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">';
            $caret = false;
          }
		  $caret = '';
          $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level);
// CATEGORY NAMES		  
          $result .= $link_title . (($caret != false) ? $caret : null) . '</a>';

		  
          if(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
            // show parent category link //	    
			$root_link_title =  '<strong><span class="fas fa-list fa-lg"></span>&nbsp;' . $link_title . '</strong>';
						
            $result .= $this->parent_start_string;
    // divider added for clarity //            
        if (MODULE_CONTENT_HEADER_CATMENU_XS_DIVIDER == 'True') {
            $result .= '<li style="border-bottom:solid 1px #e5e5e5;"><a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">' . $root_link_title . '</a></li>';
        } else {
            $result .= '<li><a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">' . $root_link_title . '</a></li>';
        }
            $result .= $this->_buildHoz_xs($category_id, $level + 1);
            $result .= $this->parent_end_string;
            $result .= $this->child_end_string;
          } else {
            $result .= $this->root_end_string;
          }

REPLACE WITH
 

		 /* if (isset($this->_data[$category_id]) && ($level != 0)) {
// HAS MORE SUBCATEGORIES			  
            $result .= '<li><a href="#">';	   
          } elseif(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
// PARENT HAS CHILD CATEGORIES			  
            $result .= $this->root_start_string;
            $result .= '<a href="#">';          			
          } else {*/
// NO SUBCATEGORIES			  
            $result .= $this->child_start_string;
            $result .= '<a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">';
            $caret = false;
        //  }
		//  $caret = '';
         // $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level);
// CATEGORY NAMES		  
          $result .= $link_title . (($caret != false) ? $caret : null) . '</a>';

		  
   /*       if(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
            // show parent category link //	    
			$root_link_title =  '<strong><span class="fas fa-list fa-lg"></span>&nbsp;' . $link_title . '</strong>';
						
            $result .= $this->parent_start_string;
    // divider added for clarity //            
        if (MODULE_CONTENT_HEADER_CATMENU_XS_DIVIDER == 'True') {
            $result .= '<li style="border-bottom:solid 1px #e5e5e5;"><a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">' . $root_link_title . '</a></li>';
        } else {
            $result .= '<li><a href="' . tep_href_link('index.php', 'cPath=' . $category_link) . '">' . $root_link_title . '</a></li>';
        }
            $result .= $this->_buildHoz_xs($category_id, $level + 1);
            $result .= $this->parent_end_string;
            $result .= $this->child_end_string;
          } else {*/
            $result .= $this->root_end_string;
          //}

 

That should do it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×