public function aroundGetMeta(CategoryDataProvider $dataProvider, \Closure $proceed)
    {
        $meta = $proceed();

        $currentCategory = $dataProvider->getCurrentCategory();

        if ($currentCategory->getId() === null || $currentCategory->getLevel() < 2) {
            $meta['display_settings']['children']['facet_config']['arguments']['data']['config']['visible'] = false;
        }

        return $meta;
    }
public function aroundGetMeta(CategoryDataProvider $dataProvider, \Closure $proceed)
    {
        $meta = $proceed();

        $currentCategory = $dataProvider->getCurrentCategory();

        if ($currentCategory->getId() === null || $currentCategory->getLevel() < 2) {
            $meta['display_settings']['children']['facet_config']['arguments']['data']['config']['visible'] = false;
        }

        return $meta;
    }
public function aroundGetMeta ( CategoryDataProvider $ dataProvider , \ Closure $ proceed ) { $ meta = $ proceed ( ) ; $ currentCategory = $ dataProvider -> getCurrentCategory ( ) ; if ( $ currentCategory -> getId ( ) === null || $ currentCategory -> getLevel ( ) < 2 ) { $ meta [ 'display_settings' ] [ 'children' ] [ 'facet_config' ] [ 'arguments' ] [ 'data' ] [ 'config' ] [ 'visible' ] = false ; } return $ meta ; }
Remove filter configuration from meta in case of a new category, or a root one.
Meta is added in the ui_component via XML.

@param CategoryDataProvider $dataProvider Data provider.
@param \Closure             $proceed      Original method.

@return array
Remove filter configuration from meta in case of a new category or a root one . Meta is added in the ui_component via XML .