I have "New Add Product" button at Sales->Order->Create New Order
which I added through plugin. My di is at: etc/adminhtml
As
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<type name="Magento\Sales\Block\Adminhtml\Order\Create\Items">
<plugin name="vendor-module-order-create-items-block" type="Vendor\Module\Plugin\Order\Create\Items" sortOrder="100" />
</type>
</config>
My plugin class is:
class Items
{
public function afterGetButtonsHtml(\Magento\Sales\Block\Adminhtml\Order\Create\Items $subject, $result)
{
$url = 'http://www.google.com';
$result .= $subject->getLayout()->createBlock(
\Magento\Backend\Block\Widget\Button::class
)->setData(
['label'=>'New Add Products', 'type'=>'button', 'id'=> 'add_new_products', 'class' => 'action-secondary action-add', 'on_click'=>"window.location.href='" . $url . "'"]
)->toHtml();
return $result;
}
}
I want to create popup like this on 'New Add Products' button click (This is in M1)
I need to know how to add popup code in plugin class? as there are many solutions available but mostly are executed by template files.