ptityop Posted November 9, 2022 Share Posted November 9, 2022 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"> </td> </tr> <tr> <td colspan="2"> </td> <td colspan="10"> {$HOOK_DISPLAY_PDF} </td> </tr> {/if} Link to comment Share on other sites More sharing options...
daniele dexter Posted November 10, 2022 Share Posted November 10, 2022 Hi, i don't understand well. Do you want to know how the invoice is created? And which hook are used to do create it? Link to comment Share on other sites More sharing options...
ptityop Posted November 11, 2022 Author Share Posted November 11, 2022 Hello, thanks for your reply... I am trying to understand what file is {$HOOK_DISPLAY_PDF} calling out ? Link to comment Share on other sites More sharing options...
daniele dexter Posted November 11, 2022 Share Posted November 11, 2022 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 More sharing options...
ptityop Posted November 11, 2022 Author Share Posted November 11, 2022 That was really helpul !! thanks ... Although I still do not get what the {$HOOK_DISPLAY_PDF} refers to, i learned somehitng else along the way :-) Link to comment Share on other sites More sharing options...
ps8modules Posted November 11, 2022 Share Posted November 11, 2022 (edited) $HOOK_DISPLAY_PDF is not hook !! It's a smarty variable. You can find it in ./classes/pdf/HTMLTemplate.php Find it: /classes/pdf/HTMLTemplate.php /pdf/delivery-slip.tpl /pdf/invoice-b2b.tpl /pdf/invoice.tpl /pdf/order-return.tpl /pdf/order-slip.tpl Edited November 11, 2022 by 4you.software (see edit history) Link to comment Share on other sites More sharing options...
ps8modules Posted November 11, 2022 Share Posted November 11, 2022 Concept: https://devdocs.prestashop-project.org/8/modules/concepts/pdf/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now