{"id":75,"date":"2025-01-07T10:07:43","date_gmt":"2025-01-07T10:07:43","guid":{"rendered":"https:\/\/hosterlink.com\/blog\/?p=75"},"modified":"2025-01-07T10:07:43","modified_gmt":"2025-01-07T10:07:43","slug":"how-to-add-additional-text-or-bank-details-on-whmcs-view-invoice-pdf-invoice","status":"publish","type":"post","link":"https:\/\/hosterlink.com\/blog\/how-to-add-additional-text-or-bank-details-on-whmcs-view-invoice-pdf-invoice\/","title":{"rendered":"How to add additional text or Bank details on WHMCS View Invoice &amp; PDF Invoice"},"content":{"rendered":"\n<p>How to add additional text or Bank details on WHMCS View Invoice &amp; PDF Invoice<\/p>\n\n\n\n<p class=\"has-medium-font-size\">If you were to use the hook code functionality, you wouldn&#8217;t need to edit any template &#8211; instead, you would create a .php file in \/includes\/hooks\/ (that&#8217;s the includes folder in your WHMCS folder and not the one in your active template folder), give it a filename, e.g someText.php and paste the below code into it&#8230;. then when you next view the invoice, and assuming it&#8217;s not a paid invoice (you can remove the if condition if this is not required), the text should be automatically added to the output.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>&lt;?php\n\nadd_hook('ClientAreaPageViewInvoice', 1, function($vars) {\n\t\n\tif ($vars&#91;'status'] != \"Paid\") {\n\t\t$pagetitle = $vars&#91;'pagetitle'];\n\t\t$pagetitle .= '&lt;br>&lt;p style=\"font-size: 11px !important;\">This is the additional text we want to show under Invoice Numeber&lt;\/p>';\n\t\treturn array(\"pagetitle\" => $pagetitle);\n\t}\n});<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\">Also if we wanted to show it as an Alert and also show it along the payment button we can modify it as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>&lt;?php\n\nadd_hook('ClientAreaPageViewInvoice', 1, function($vars) {\n\n        if ($vars&#91;'status'] != \"Paid\") {\n                $paymentbutton = $vars&#91;'paymentbutton'];\n                $paymentbutton .= '&lt;br>&lt;p class=\"alert alert-info\">This is the additional text we want to show under Invoice Numeber&lt;\/p>';\n                return array(\"paymentbutton\" => $paymentbutton);\n        }\n});<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\">Now, However if you wanted to add this text to the PDF Invoice template also, \u00a0then you would have to edit the invoicepdf.tpl template.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>if ($status != 'Paid') {\n\t$pdf->MultiCell(0, 6, 'We complete a new anti-fraud check before processing any payments, this may delay your invoice being marked as Paid.', 0, 'C', false, 1);\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to add additional text or Bank details on WHMCS View Invoice &amp; PDF Invoice If you were to use the hook code functionality, you wouldn&#8217;t need to edit any template &#8211; instead, you would create a .php file in \/includes\/hooks\/ (that&#8217;s the includes folder in your WHMCS folder and not the one in your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"_links":{"self":[{"href":"https:\/\/hosterlink.com\/blog\/wp-json\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosterlink.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosterlink.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosterlink.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosterlink.com\/blog\/wp-json\/wp\/v2\/comments?post=75"}],"version-history":[{"count":1,"href":"https:\/\/hosterlink.com\/blog\/wp-json\/wp\/v2\/posts\/75\/revisions"}],"predecessor-version":[{"id":77,"href":"https:\/\/hosterlink.com\/blog\/wp-json\/wp\/v2\/posts\/75\/revisions\/77"}],"wp:attachment":[{"href":"https:\/\/hosterlink.com\/blog\/wp-json\/wp\/v2\/media?parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosterlink.com\/blog\/wp-json\/wp\/v2\/categories?post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosterlink.com\/blog\/wp-json\/wp\/v2\/tags?post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}