I am using magento 2.3.3 and I want to print order invoice in Arabic language with RLT layout. from Magento 2 admin => sales => invoice => View
=> [Print in Arabic]
Can anyone suggest me or give here some code how can I do this funcanility
Create a plugin in Company/Module/etc/adminhtml/di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Backend\Block\Widget\Button\Toolbar">
<plugin name="Company_Module::pluginBefore" type="Company\Module\Plugin\PluginBefore" />
</type>
</config>
Then in Company\Module\Plugin\PluginBefore.php
namespace Company\Module\Plugin;
class PluginBefore
{
public function beforePushButtons(
\Magento\Backend\Block\Widget\Button\Toolbar\Interceptor $subject,
\Magento\Framework\View\Element\AbstractBlock $context,
\Magento\Backend\Block\Widget\Button\ButtonList $buttonList
) {
$this->_request = $context->getRequest();
if($this->_request->getFullActionName() == 'sales_order_view'){
$buttonList->add(
'mybutton',
['label' => __('My Button'), 'onclick' => 'setLocation(window.location.href)', 'class' => 'reset'],
-1
);
}
}
}