src/ShopBundle/objects/db/TShopCategory.class.php
public function AllowDisplayInShop()
    {
        $bShowCat = false;

        $oShop = TdbShop::GetInstance();
        if (!is_null($oShop) && !$oShop->fieldShowEmptyCategories) {
            $bShowCat = ($this->GetNumberOfArticlesInCategory(true) > 0);
        } else {
            $bShowCat = true;
        }

        if (false == $this->fieldActive || false == $this->fieldTreeActive) {
            $bShowCat = false;
        }

        $targetPage = $this->getTargetPage();
        if (null === $targetPage || false === $targetPage) {
            return true;
        }
        // show only if the user has access to the category target page
        if (false === $targetPage->AllowAccessByCurrentUser()) {
            return false;
        }

        return $bShowCat;
    }
public function AllowDisplayInShop()
    {
        $bShowCat = false;

        $oShop = TdbShop::GetInstance();
        if (!is_null($oShop) && !$oShop->fieldShowEmptyCategories) {
            $bShowCat = ($this->GetNumberOfArticlesInCategory(true) > 0);
        } else {
            $bShowCat = true;
        }

        if (false == $this->fieldActive || false == $this->fieldTreeActive) {
            $bShowCat = false;
        }

        $targetPage = $this->getTargetPage();
        if (null === $targetPage || false === $targetPage) {
            return true;
        }
        // show only if the user has access to the category target page
        if (false === $targetPage->AllowAccessByCurrentUser()) {
            return false;
        }

        return $bShowCat;
    }
public function AllowDisplayInShop ( ) { $ bShowCat = false ; $ oShop = TdbShop :: GetInstance ( ) ; if ( ! is_null ( $ oShop ) && ! $ oShop -> fieldShowEmptyCategories ) { $ bShowCat = ( $ this -> GetNumberOfArticlesInCategory ( true ) > 0 ) ; } else { $ bShowCat = true ; } if ( false == $ this -> fieldActive || false == $ this -> fieldTreeActive ) { $ bShowCat = false ; } $ targetPage = $ this -> getTargetPage ( ) ; if ( null === $ targetPage || false === $ targetPage ) { return true ; } // show only if the user has access to the category target page if ( false === $ targetPage -> AllowAccessByCurrentUser ( ) ) { return false ; } return $ bShowCat ; }
Hook for implementing category display logic.

@return bool
Hook for implementing category display logic .