Jump to content

How to know which hook display pdf is being displayed in tpl files


ptityop

Recommended Posts

Hello,

I am trying to work out how to know which hooks are being displayed in the invoice or other tpl files as shown in the code below ... the only info is Hook_display_pdf but how do we know which pdf is being displayed , how the order is determined .... other than obviously printing the invoice ... what is the logic behind this ? Thanks in advance ...

 

<!-- Hook -->
	{if isset($HOOK_DISPLAY_PDF)}
	<tr>
		<td colspan="12" height="30">&nbsp;</td>
	</tr>

	<tr>
		<td colspan="2">&nbsp;</td>
		<td colspan="10">
			{$HOOK_DISPLAY_PDF}
		</td>
	</tr>
	{/if}

 

Link to comment
Share on other sites

11 minutes ago, ptityop said:

Hello, thanks for your reply... I am trying to understand what file is  {$HOOK_DISPLAY_PDF} calling out ? 

I don't  understand what the command {$HOOK_DISPLAY_PDF} does either me.

I can tell you that when the invoice pdf is created this is using some tpl together.

You can found them in directory -> /pdf

 

In the file public_html/classes/pdf/HTMLTemplateInvoice.php i saw this instructions:

$tpls = [
            'style_tab' => $this->smarty->fetch($this->getTemplate('invoice.style-tab')),
            'addresses_tab' => $this->smarty->fetch($this->getTemplate('invoice.addresses-tab')),
            'summary_tab' => $this->smarty->fetch($this->getTemplate('invoice.summary-tab')),
            'product_tab' => $this->smarty->fetch($this->getTemplate('invoice.product-tab')),
            'tax_tab' => $this->getTaxTabContent(),
            'payment_tab' => $this->smarty->fetch($this->getTemplate('invoice.payment-tab')),
            'note_tab' => $this->smarty->fetch($this->getTemplate('invoice.note-tab')),
            'total_tab' => $this->smarty->fetch($this->getTemplate('invoice.total-tab')),
            'shipping_tab' => $this->smarty->fetch($this->getTemplate('invoice.shipping-tab')),
        ];
 

I tried to copy these tpl and header.tpl + footer.tpl in a new directory -> themes/name-of-theme-child/pdf 

After i modified these files i saw that my changes were successfully done in the invoice pdf.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...