How can I set opened state to inactive for bundle items tab in product edit page Magento 2 so that the tab is loaded only on click, not on page load. For more information: https://stackoverflow.com/questions/41947465/how-to-close-all-accordions-in-magento2-admin-product-detail-by-default

Thanks in Advance!

1 Answer 1


You can try to Overriding ( as described below ) the class Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePane for your requirement.

I assume you will create a custom module name "Vendor_Module" to do this customization tasks

step 1) Create di.xml under


File : di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePanel" 
                type="Vendor\Module\Ui\DataProvider\Product\Form\Modifier\BundlePanel" />

step 2: Create BundlePanel.php under


File : BundlePanel.php


namespace Vendor\Module\Ui\DataProvider\Product\Form\Modifier;

class BundlePanel extends \Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePanel

     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
    public function modifyMeta(array $meta)
        $meta = parent::modifyMeta($meta);
        $path = $this->arrayManager->findPath(static::CODE_BUNDLE_DATA, $meta, null, 'children');
        $meta = $this->arrayManager->merge(
                'arguments' => [
                    'data' => [
                        'config' => [
                            'dataScope' => '',
                            'opened' => false,
                            'sortOrder' => $this->getNextGroupSortOrder(
        return $meta;


step 3: Run di compile commnad

sudo php bin/magento setup:di:compile

step 4: clean your Magento cache


Please Note:

To Show/hide the Bundle Items tab, Please change $meta array key value to true/false in the Overriding class file Vendor\Module\Ui\DataProvider\Product\Form\Modifier\BundlePanel.php as follows :

'opened' => false,



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.