Your IP : 127.0.0.1


Current Path : /home/dev2.destoffenstraat.com/app/code/Destoff/Custom/Rewrite/Product/
Upload File :
Current File : /home/dev2.destoffenstraat.com/app/code/Destoff/Custom/Rewrite/Product/Related.php

<?php

declare(strict_types=1);

namespace Destoff\Custom\Rewrite\Product;

use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related as CoreRelated;
use Magento\Ui\Component\Form\Fieldset;

class Related extends CoreRelated
{
    private static $previousGroup = 'migration-productopties';
    private static $sortOrder = 90;

    public function modifyMeta(array $meta)
    {
        $meta = array_replace_recursive(
            $meta,
            [
                static::GROUP_RELATED => [
                    'children' => [
                        $this->scopePrefix . static::DATA_SCOPE_RELATED => $this->getRelatedFieldset(),
                        $this->scopePrefix . static::DATA_SCOPE_UPSELL => $this->getUpSellFieldset(),
                        $this->scopePrefix . static::DATA_SCOPE_CROSSSELL => $this->getCrossSellFieldset(),
                    ],
                    'arguments' => [
                        'data' => [
                            'config' => [
                                'label' => __('Related Products, Up-Sells, and Cross-Sells'),
                                'collapsible' => true,
                                'componentType' => Fieldset::NAME,
                                'dataScope' => static::DATA_SCOPE,
                                'sortOrder' =>
                                    $this->getNextGroupSortOrder(
                                        $meta,
                                        self::$previousGroup,
                                        self::$sortOrder,
                                        15
                                    ),
                            ],
                        ],

                    ],
                ],
            ]
        );

        return $meta;
    }
}