I have created plugin for add textbox in product attribute form.
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">
<type name="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front">
<plugin name="extension_attribute_edit_form" type="Vendor\Module\Plugin\Block\Adminhtml\Product\Attribute\Edit\Tab\Front" sortOrder="1"/>
</type>
</config>
Vendor\Module\Plugin\Block\Adminhtml\Product\Attribute\Edit\Tab\Front.php
<?php
namespace Vendor\Module\Plugin\Block\Adminhtml\Product\Attribute\Edit\Tab;
class Front
{
public function aroundGetFormHtml(
\Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front $subject,
\Closure $proceed
)
{
$form = $subject->getForm();
$fieldset = $form->getElement('front_fieldset');
$fieldset->addField(
'stn_price',
'text',
[
'name' => 'stn_price',
'label' => __('Stone Price'),
'title' => __('Stone Price'),
'required' => false
]
);
return $proceed();
}
}
Vendor\Module\etc\db_schema.xml
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="catalog_eav_attribute" resource="default" engine="innodb" comment="Catalog EAV Attribute Table">
<column xsi:type="int" name="stn_price" unsigned="true" nullable="false"
identity="false" default="0" comment="Stone Weight"/>
</table>
</schema>
