2 replies [Last post]
bhardy101's picture
Offline
Joined: 02/26/2009
Juice: 25
Was this information Helpful?

I'm sure this has to have already been asked, but i can't find a direct answer, or solution other than a work around (Custom Menu), additional module (taxonomyblocks).. etc

I want the Ubercart Catalog Vocabulary's to be displayed at all times, via the default uc_catalog block, even if i don't have them populated with products.

I understand that when you add a taxonomy term to the ubercart Taxonomy Catalog, that you need a Product within that Taxonomy in order for that Taxonomy Term to be displayed. First solution was to create an additional Menu Block, and then add the Catalog Terms to that menu. There's also the taxonomyblocks module... Problem is I'm creating a catalog that will have 100+ Parent and Child objects, and i don't want to create it twice. Am i missing something?

Thank you in advance

bhardy101's picture
Offline
Joined: 02/26/2009
Juice: 25
Re: Always Display Ubercart Catalog Vocabulary - Even if no Prod

Am i posting this in the wrong area? Or asking a dead question?

supadit's picture
Offline
Joined: 04/16/2011
Juice: 5
Re: Always Display Ubercart Catalog Vocabulary - Even if no Prod

I took the hard route by editing

uc_catalog.pages.inc in ubercart/uc_catalog

in function theme_uc_catalog_browse at line 33

    if (!empty($child->nodes)) {
      $links[] = array('title' => $child->name . (variable_get('uc_catalog_breadcrumb_nodecount', FALSE) ? ' ('. $child->nodes .')' : ''), 'href' => uc_catalog_path($child),
        'attributes' => array('rel' => 'tag'),
      );
    }

comment the if statement out, result as

//     if (!empty($child->nodes)) {
      $links[] = array('title' => $child->name . (variable_get('uc_catalog_breadcrumb_nodecount', FALSE) ? ' ('. $child->nodes .')' : ''), 'href' => uc_catalog_path($child),
        'attributes' => array('rel' => 'tag'),
      );
//     }

And in line 71

    if ($child->nodes) {
      $cell_link = $image .'<strong>'. l($child->name, uc_catalog_path($child)) .'</strong>';
      if (variable_get('uc_catalog_show_subcategories', TRUE)) {
        $cell_link .= "<br /><span>". implode(', ', $grandchildren) ."</span>\n";
      }
      $child_list[] = $cell_link;
    }

Also comment the if statement out

//     if ($child->nodes) {
      $cell_link = $image .'<strong>'. l($child->name, uc_catalog_path($child)) .'</strong>';
      if (variable_get('uc_catalog_show_subcategories', TRUE)) {
        $cell_link .= "<br /><span>". implode(', ', $grandchildren) ."</span>\n";
      }
      $child_list[] = $cell_link;
//    }