6 replies [Last post]
deanloh's picture
Offline
Joined: 08/20/2007
Juice: 27
Was this information Helpful?

Our product category structure look like this:

Catalog
--Menswear
----Jackets
----Pants
--Womenswear
----Blouse
----Skirts
--Kids
----Tees
----Shorts

We need help in disabling the link on Menswear, Womenswear, and Kids - reason being, our block menu is set to expand by default, users can go direct to individual categories such as Jackets, Pants, Blouse etc, there is no need to load the main category pages.

Please offer your price for making such modification.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Categrory links in catalog block

So basically you don't want a link in that block to any category in the catalog that has subcategories? When you're browsing from the root of the catalog, I assume they should still display?

mavielma's picture
Offline
Joined: 01/23/2008
Juice: 182
Re: Categrory links in catalog block

I have a contribution here. http://www.ubercart.org/contrib/3202 . May be you have to check.

deanloh's picture
Offline
Joined: 08/20/2007
Juice: 27
Re: Categrory links in catalog block

This will help you understand better:
http://monicaquen.com.sg/

On the left: Menswear, Womenswear, Accessories should not be clickable.

There is no link to root of catalog, so it isn't much an issue. Then again, unless the user enters the URL directly, i.e. http://monicaquen.com.sg/catalog but I'm sure very few people would do that, if not none.

rolandk's picture
Offline
Joined: 02/06/2008
Juice: 240
Re: Re: Categrory links in catalog block

I'd be interested in seeing the solution too.

rolandk's picture
Offline
Joined: 02/06/2008
Juice: 240
Re: Re: Re: Categrory links in catalog block
mavielma's picture
Offline
Joined: 01/23/2008
Juice: 182
Re: Categrory links in catalog block

I am not sure whether this helps. Please try.

Under your drupalPath\theme directory find your theme and add the following function to your templete.php file. If you do not have a templete.php you have to create one. And change the YOURTHEME with your theme. This avoids the link form expandable items.

<?php
function YOURTHEME_uc_catalog_item($here, $active_link = '', $lis, $expand, $inpath, $link, $count_children ){
 
$output='';

  if (

$expand || $count_children){
    if (
$here){
     
$output = '<li class="expanded"><strong>'. $active_link ."</strong>\n";
      if (
count($lis)){
       
$output .= '<ul class="menu">';
        foreach (
$lis as $li){
         
$output .= $li ."\n";
        }
       
$output .= "</ul>\n";
      }
     
$output .= "</li>";
    }
    elseif (
$expand || $inpath){
      if (
count($lis)) {
       
$mylink = substr($link,strpos($link, '">')+2);
       
$mylink = str_replace('</a>','',$mylink);
       
$output = '<li class="expanded">'. ($referer == $branch_path ? '<strong>' : '') . $mylink . ($referer == $branch_path ? '</strong>' : '') ."\n";
      }
      else {
       
$output = '<li class="expanded">'. ($referer == $branch_path ? '<strong>' : '') . $link . ($referer == $branch_path ? '</strong>' : '') ."\n";
      }
    
      if (
count($lis)){
       
$output .= '<ul class="menu">';
        foreach (
$lis as $li){
         
$output .= $li;
        }
       
$output .= "</ul>\n";
      }
     
$output .= "</li>";
    }
    else{
     
$output = '<li class="collapsed">'. $link ."</li>\n";
    }
  }
  else{
   
$output = '<li class="leaf">'. ($inpath ? '<strong>' : '') . ($here ? $active_link : $link) . ($inpath ? '</strong>' : '') .'</li>'. "\n";
  }

  return

$output;
}
?>