I want to add Custom Field at Product Edit Page(Admin Side) like related/upsell/crosssell product i want to add Custom Products for it, found much similar solution but it's not working at all,If you know how to, Please help me out..
<?php
namespace CustomField\Ui\DataProvider;
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
use Magento\Ui\Component\Form\Fieldset;
use Magento\Ui\Component\Form\Field;
class Fields extends AbstractModifier
{
/**
* @param array $data
* @return array
* @since 100.1.0
*/
public function modifyData(array $data)
{
return $data;
}
/**
* @param array $meta
* @return array
* @since 100.1.0
*/
public function modifyMeta(array $meta)
{
$meta = array_replace_recursive(
$meta,
[
'yash' => [
'arguments' => [
'data' => [
'config' => [
'label' => __('Add to Custom Products'),
'collapsible' => true,
'componentType' => Fieldset::NAME,
'dataScope' => 'data.ktpl',
'sortOrder' => 10
],
],
],
],
]
);
return $meta;
}
protected function getButtonSet()
{
return [
'arguments' => [
'data' => [
'config' => [
'formElement' => 'container',
'componentType' => 'container',
'label' => false,
'content' => 'This ',
'template' => 'ui/form/components/complex',
],
],
]
];
}
}
Thanks