app/code/Vendor/Module/etc/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\Catalog\Ui\DataProvider\Product\Form\Modifier\Related" type="Vendor\Module\Model\Related" />
</config>
app/code/Vendor/Module/Model/Related.php
<?php
namespace Vendor\Module\Model;
use Magento\Ui\Component\Form\Fieldset;
class Related extends \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related
{
/**
* @var string
*/
private static $previousGroup = 'search-engine-optimization';
/**
* @var int
*/
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
),
],
],
],
],
]
);
return $meta;
}
protected function getCrossSellFieldset()
{
$content = __(
'These "impulse-buy" products appear next to the shopping cart' .
' as cross-sells to the items already in the shopping cart.'
);
return [
'children' => [
'button_set' => $this->getButtonSet(
$content,
__('Add Cross-Sell Products'),
$this->scopePrefix . static::DATA_SCOPE_CROSSSELL
),
'modal' => $this->getGenericModal(
__('Add Cross-Sell Products'),
$this->scopePrefix . static::DATA_SCOPE_CROSSSELL
),
static::DATA_SCOPE_CROSSSELL => $this->getGrid($this->scopePrefix . static::DATA_SCOPE_CROSSSELL),
],
'arguments' => [
'data' => [
'config' => [
'additionalClasses' => 'admin__fieldset-section',
'label' => __('Test Sell Products'),
'collapsible' => false,
'componentType' => Fieldset::NAME,
'dataScope' => '',
'sortOrder' => 30,
],
],
]
];
}
}
Thanks,