---
title: "How to Get Child Items of Bundle Products in Magento 2"
url: "https://magecomp.com/blog/get-child-items-of-bundle-products-magento-2/"
date: "2022-02-14T15:02:47+00:00"
modified: "2025-02-19T05:06:06+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 227
reading_time: "2 min read"
summary: "Hello Magento Friends,"
description: "Get all child items from bundled products in Magento 2. Create Bundlechildproduct.php file and add the code."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Get Product Image URL in Magento 2"
    url: "https://magecomp.com/blog/how-to-get-product-image-url-in-magento-2/"
  - title: "How to Make Purchase Order Number Field Optional in Magento 2?"
    url: "https://magecomp.com/blog/make-purchase-order-number-field-optional-magento-2/"
  - title: "How to get sub category details using main category URL key in Magento 2"
    url: "https://magecomp.com/blog/get-sub-category-details-using-main-category-url-key-magento-2/"
---

# How to Get Child Items of Bundle Products in Magento 2

_Published: February 14, 2022_  
_Author: Dhiren Vasoya_  

![How to Get Child Items of Bundle Products in Magento 2](https://magecomp.com/blog/wp-content/uploads/2022/02/How-to-Get-Child-Items-of-Bundle-Products-in-Magento-2-1024x512.webp)

**Hello Magento Friends,**

I am again back with another useful Magento solution for you all. Today it’s about Getting Child Items of Bundle Products in Magento 2.
Bundled products are a group of simple or virtual products that are bought together. You can [**Create Bundled Products Programmatically in Magneto 2**](https://magecomp.com/blog/create-bundled-product-programmatically-magento-2/). Bundled products are a combination of various child products. To get all the child items of bundled products, you can follow the below steps.
## [![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-3.webp)](https://magecomp.com/magento-performance-optimization.html)

## Steps to Get Child Items of Bundle Products in Magento 2:
**Step 1:** Create a file at the below path
**app\code\Vendor\Extension\Model\Bundlechildproduct.php**

And add the below code
```
<?php
namespace VendorExtensionModel;

use Exception;
use PsrLogLoggerInterface;
use MagentoBundleApiProductLinkManagementInterface;

class  Bundlechildproduct
{
    private $logger;

    private $productLinkManagement;

    public function __construct(
        LoggerInterface $logger,
        ProductLinkManagementInterface $productLinkManagement)
    {
        $this->logger = $logger;
        $this->productLinkManagement = $productLinkManagement;
    }

    public function getBundleChildrenItems()
    {
        $sku = 'YOUR_PRODUCT_SKU';
        try
        {
            $items = $this->productLinkManagement->getChildren($sku);
        }
        catch (Exception $exception)
        {
            throw new Exception($exception->getMessage());
        }

        return $items;
    }
}
```

[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-1.webp)](https://magecomp.com/services/hyva-theme-development/)

**Step 2:** Call from the template or Any PHP class
```
$items = $this->getBundleChildrenItems();
foreach ($items as $item)
{
    var_dump($item->getData());
}
```

## [![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-5.webp)](https://magecomp.com/services/hire-magento-programmer/)

## Conclusion:
This way you can fetch child items from the bundled products in Magento 2. In case you come across any error, reach me via the comment box. Share the article with your friends and stay updated!
**Happy Coding!**


---

_View the original post at: [https://magecomp.com/blog/get-child-items-of-bundle-products-magento-2/](https://magecomp.com/blog/get-child-items-of-bundle-products-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-11 04:13:12 UTC_  
