CatalogController.php in Ubercart 8.4        
                          
                  
                        
  
  
  
  
  
File
  uc_catalog/src/Controller/CatalogController.php
  
    View source  
  <?php
namespace Drupal\uc_catalog\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\taxonomy\TermInterface;
class CatalogController extends ControllerBase {
  
  public function catalogPage(TermInterface $taxonomy_term) {
    
    $taxonomy_term->forums = $this->forumManager
      ->getChildren($this
      ->config('forum.settings')
      ->get('vocabulary'), $taxonomy_term
      ->id());
    $taxonomy_term->parents = $this->forumManager
      ->getParents($taxonomy_term
      ->id());
    if (empty($taxonomy_term->forum_container->value)) {
      $build = $this->forumManager
        ->getTopics($taxonomy_term
        ->id(), $this
        ->currentUser());
      $topics = $build['topics'];
      $header = $build['header'];
    }
    else {
      $topics = '';
      $header = [];
    }
    return $this
      ->build($taxonomy_term->forums, $taxonomy_term, $topics, $taxonomy_term->parents, $header);
  }
}