0

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]

enter image description here

Can anyone suggest me or give here some code how can I do this funcanility

Ronak Rathod
  • 6,322
  • 17
  • 42
Deexit Sanghani
  • 1,490
  • 1
  • 15
  • 32

1 Answers1

0

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
            );
        }

    }
}

Ref Link

Ronak Rathod
  • 6,322
  • 17
  • 42