I’m trying to show the logo in /sales/order/print page from the frontend orders account dashboard like this:
sales_order_print.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="sales_order_print_renderers" />
<update handle="sales_order_item_price"/>
<update handle="print" />
<body>
<referenceContainer name="content">
<block class="MagentoFrameworkViewElementTemplate" name="invoice.logo" template="Magento_Theme::invoice-logo.phtml" before="-" />
</referenceContainer>
<move element="page.main.title" destination="content" after="invoice.logo"/>
</body>
</page>
In the above code, I’m rendering an invoice-logo.phtml
(custom) file that contains the logo image.
I thought if I would be able to show the logo on /sales/order/print page then the logo would automatically show up on the invoice pdf because Magento takes the same page and converts it into pdf for print.
By doing this, The logo shows up on /sales/order/print page but it’s not showing up on the invoice pdf window.
I have attached the screenshot below.
Seems like in the PDF it takes the place of the image but never renders it. Do you know what could be the reason for the logo not showing up? Also, is my approach correct? Am I messing up with the right files?
I tried uploading the logo through admin but realized it’s only for admin order invoices and not for frontend orders.
Any help would be appreciated.