controller/frontend/src/Controller/Frontend/Catalog/Standard.php
public function visible( array $catIds )
	{
		if( empty( $catIds ) ) {
			return $this;
		}

		$config = $this->getContext()->getConfig();

		$expr = [
			$this->filter->compare( '==', 'catalog.parentid', $catIds ),
			$this->filter->compare( '==', 'catalog.id', $catIds )
		];

		/** controller/frontend/catalog/levels-always
		 * The number of levels in the category tree that should be always displayed
		 *
		 * Usually, only the root node and the first level of the category
		 * tree is shown in the frontend. Only if the user clicks on a
		 * node in the first level, the page reloads and the sub-nodes of
		 * the chosen category are rendered as well.
		 *
		 * Using this configuration option you can enforce the given number
		 * of levels to be always displayed. The root node uses level 0, the
		 * categories below level 1 and so on.
		 *
		 * In most cases you can set this value via the administration interface
		 * of the shop application. In that case you often can configure the
		 * levels individually for each catalog filter.
		 *
		 * Note: This setting was available between 2014.03 and 2019.04 as
		 * client/html/catalog/filter/tree/levels-always
		 *
		 * @param integer Number of tree levels
		 * @since 2019.04
		 * @category User
		 * @category Developer
		 * @see controller/frontend/catalog/levels-only
		*/
		if( ( $levels = $config->get( 'controller/frontend/catalog/levels-always' ) ) != null ) {
			$expr[] = $this->filter->compare( '<=', 'catalog.level', $levels );
		}

		/** controller/frontend/catalog/levels-only
		 * No more than this number of levels in the category tree should be displayed
		 *
		 * If the user clicks on a category node, the page reloads and the
		 * sub-nodes of the chosen category are rendered as well.
		 * Using this configuration option you can enforce that no more than
		 * the given number of levels will be displayed at all. The root
		 * node uses level 0, the categories below level 1 and so on.
		 *
		 * In most cases you can set this value via the administration interface
		 * of the shop application. In that case you often can configure the
		 * levels individually for each catalog filter.
		 *
		 * Note: This setting was available between 2014.03 and 2019.04 as
		 * client/html/catalog/filter/tree/levels-only
		 *
		 * @param integer Number of tree levels
		 * @since 2014.03
		 * @category User
		 * @category Developer
		 * @see controller/frontend/catalog/levels-always
		 */
		if( ( $levels = $config->get( 'controller/frontend/catalog/levels-only' ) ) != null ) {
			$this->conditions[] = $this->filter->compare( '<=', 'catalog.level', $levels );
		}

		$this->conditions[] = $this->filter->combine( '||', $expr );
		return $this;
	}
public function visible( array $catIds )
	{
		if( empty( $catIds ) ) {
			return $this;
		}

		$config = $this->getContext()->getConfig();

		$expr = [
			$this->filter->compare( '==', 'catalog.parentid', $catIds ),
			$this->filter->compare( '==', 'catalog.id', $catIds )
		];

		/** controller/frontend/catalog/levels-always
		 * The number of levels in the category tree that should be always displayed
		 *
		 * Usually, only the root node and the first level of the category
		 * tree is shown in the frontend. Only if the user clicks on a
		 * node in the first level, the page reloads and the sub-nodes of
		 * the chosen category are rendered as well.
		 *
		 * Using this configuration option you can enforce the given number
		 * of levels to be always displayed. The root node uses level 0, the
		 * categories below level 1 and so on.
		 *
		 * In most cases you can set this value via the administration interface
		 * of the shop application. In that case you often can configure the
		 * levels individually for each catalog filter.
		 *
		 * Note: This setting was available between 2014.03 and 2019.04 as
		 * client/html/catalog/filter/tree/levels-always
		 *
		 * @param integer Number of tree levels
		 * @since 2019.04
		 * @category User
		 * @category Developer
		 * @see controller/frontend/catalog/levels-only
		*/
		if( ( $levels = $config->get( 'controller/frontend/catalog/levels-always' ) ) != null ) {
			$expr[] = $this->filter->compare( '<=', 'catalog.level', $levels );
		}

		/** controller/frontend/catalog/levels-only
		 * No more than this number of levels in the category tree should be displayed
		 *
		 * If the user clicks on a category node, the page reloads and the
		 * sub-nodes of the chosen category are rendered as well.
		 * Using this configuration option you can enforce that no more than
		 * the given number of levels will be displayed at all. The root
		 * node uses level 0, the categories below level 1 and so on.
		 *
		 * In most cases you can set this value via the administration interface
		 * of the shop application. In that case you often can configure the
		 * levels individually for each catalog filter.
		 *
		 * Note: This setting was available between 2014.03 and 2019.04 as
		 * client/html/catalog/filter/tree/levels-only
		 *
		 * @param integer Number of tree levels
		 * @since 2014.03
		 * @category User
		 * @category Developer
		 * @see controller/frontend/catalog/levels-always
		 */
		if( ( $levels = $config->get( 'controller/frontend/catalog/levels-only' ) ) != null ) {
			$this->conditions[] = $this->filter->compare( '<=', 'catalog.level', $levels );
		}

		$this->conditions[] = $this->filter->combine( '||', $expr );
		return $this;
	}
public function visible ( array $ catIds ) { if ( empty ( $ catIds ) ) { return $ this ; } $ config = $ this -> getContext ( ) -> getConfig ( ) ; $ expr = [ $ this -> filter -> compare ( '==' , 'catalog.parentid' , $ catIds ) , $ this -> filter -> compare ( '==' , 'catalog.id' , $ catIds ) ] ; /** controller/frontend/catalog/levels-always
		 * The number of levels in the category tree that should be always displayed
		 *
		 * Usually, only the root node and the first level of the category
		 * tree is shown in the frontend. Only if the user clicks on a
		 * node in the first level, the page reloads and the sub-nodes of
		 * the chosen category are rendered as well.
		 *
		 * Using this configuration option you can enforce the given number
		 * of levels to be always displayed. The root node uses level 0, the
		 * categories below level 1 and so on.
		 *
		 * In most cases you can set this value via the administration interface
		 * of the shop application. In that case you often can configure the
		 * levels individually for each catalog filter.
		 *
		 * Note: This setting was available between 2014.03 and 2019.04 as
		 * client/html/catalog/filter/tree/levels-always
		 *
		 * @param integer Number of tree levels
		 * @since 2019.04
		 * @category User
		 * @category Developer
		 * @see controller/frontend/catalog/levels-only
		*/ if ( ( $ levels = $ config -> get ( 'controller/frontend/catalog/levels-always' ) ) != null ) { $ expr [ ] = $ this -> filter -> compare ( '<=' , 'catalog.level' , $ levels ) ; } /** controller/frontend/catalog/levels-only
		 * No more than this number of levels in the category tree should be displayed
		 *
		 * If the user clicks on a category node, the page reloads and the
		 * sub-nodes of the chosen category are rendered as well.
		 * Using this configuration option you can enforce that no more than
		 * the given number of levels will be displayed at all. The root
		 * node uses level 0, the categories below level 1 and so on.
		 *
		 * In most cases you can set this value via the administration interface
		 * of the shop application. In that case you often can configure the
		 * levels individually for each catalog filter.
		 *
		 * Note: This setting was available between 2014.03 and 2019.04 as
		 * client/html/catalog/filter/tree/levels-only
		 *
		 * @param integer Number of tree levels
		 * @since 2014.03
		 * @category User
		 * @category Developer
		 * @see controller/frontend/catalog/levels-always
		 */ if ( ( $ levels = $ config -> get ( 'controller/frontend/catalog/levels-only' ) ) != null ) { $ this -> conditions [ ] = $ this -> filter -> compare ( '<=' , 'catalog.level' , $ levels ) ; } $ this -> conditions [ ] = $ this -> filter -> combine ( '||' , $ expr ) ; return $ this ; }
Limits categories returned to only visible ones depending on the given category IDs

@param array $catIds List of category IDs
@return \Aimeos\Controller\Frontend\Catalog\Iface Catalog controller for fluent interface
Limits categories returned to only visible ones depending on the given category IDs