private function filterCompositeProducts($indexData)
    {
        $compositeProductTypes = $this->resourceModel->getCompositeTypes();

        foreach ($indexData as $productId => $productData) {
            $isComposite = in_array($productData['type_id'], $compositeProductTypes);
            $hasChildren = isset($productData['children_ids']) && !empty($productData['children_ids']);
            if ($isComposite && !$hasChildren) {
                unset($indexData[$productId]);
            }
        }

        return $indexData;
    }
private function filterCompositeProducts($indexData)
    {
        $compositeProductTypes = $this->resourceModel->getCompositeTypes();

        foreach ($indexData as $productId => $productData) {
            $isComposite = in_array($productData['type_id'], $compositeProductTypes);
            $hasChildren = isset($productData['children_ids']) && !empty($productData['children_ids']);
            if ($isComposite && !$hasChildren) {
                unset($indexData[$productId]);
            }
        }

        return $indexData;
    }
private function filterCompositeProducts ( $ indexData ) { $ compositeProductTypes = $ this -> resourceModel -> getCompositeTypes ( ) ; foreach ( $ indexData as $ productId => $ productData ) { $ isComposite = in_array ( $ productData [ 'type_id' ] , $ compositeProductTypes ) ; $ hasChildren = isset ( $ productData [ 'children_ids' ] ) && ! empty ( $ productData [ 'children_ids' ] ) ; if ( $ isComposite && ! $ hasChildren ) { unset ( $ indexData [ $ productId ] ) ; } } return $ indexData ; }
Filter out composite product when no enabled children are attached.

@param array $indexData Indexed data.

@return array
Filter out composite product when no enabled children are attached .