{"id":3355,"date":"2026-06-02T04:56:54","date_gmt":"2026-06-02T04:56:54","guid":{"rendered":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/?p=3355"},"modified":"2026-06-02T05:00:23","modified_gmt":"2026-06-02T05:00:23","slug":"template-override-guide","status":"publish","type":"post","link":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/kivicare-lite\/documentation\/features\/template-override-guide\/","title":{"rendered":"Template Override Guide"},"content":{"rendered":"<div class=\"nolwrap\">\n<p>This article covers every overridable template in&nbsp;<strong>KiviCare<\/strong>&nbsp;(core) and&nbsp;<strong>KiviCare Pro<\/strong>, where each template lives, what data variables it receives, and how to safely override it from your child theme without touching plugin files.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-the-override-system-works\">How the Override System Works<\/h2>\n\n\n\n<p>All print\/PDF templates use a three-level lookup \u2014 the first file found wins:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1. your-child-theme\/kivicare\/&lt;TemplateName&gt;.php   \u2190 your customisation\n2. your-parent-theme\/kivicare\/&lt;TemplateName&gt;.php  \u2190 theme-level fallback\n3. wp-content\/plugins\/&lt;plugin&gt;\/templates\/&lt;TemplateName&gt;.php  \u2190 plugin default\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Rule:<\/strong>&nbsp;Never edit files inside&nbsp;<code>wp-content\/plugins\/<\/code>. Copy the template to your child theme and edit that copy. Plugin updates will not touch your child theme.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"quick-reference\">Quick Reference<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Template File<\/th><th class=\"has-text-align-left\" data-align=\"left\">Plugin<\/th><th class=\"has-text-align-left\" data-align=\"left\">Override Path (child theme)<\/th><th class=\"has-text-align-left\" data-align=\"left\">Output<\/th><\/tr><\/thead><tbody><tr><td><code>KCInvoicePrintTemplate.php<\/code><\/td><td>kivicare-clinic-management-system<\/td><td><code>kivicare\/KCInvoicePrintTemplate.php<\/code><\/td><td>PDF<\/td><\/tr><tr><td><code>KCBillPrintTemplate.php<\/code><\/td><td>kivicare-pro<\/td><td><code>kivicare\/KCBillPrintTemplate.php<\/code><\/td><td>PDF<\/td><\/tr><tr><td><code>KCEncounterPrintTemplate.php<\/code><\/td><td>kivicare-pro<\/td><td><code>kivicare\/KCEncounterPrintTemplate.php<\/code><\/td><td>PDF<\/td><\/tr><tr><td><code>KCPrescriptionPrintTemplate.php<\/code><\/td><td>kivicare-pro<\/td><td><code>kivicare\/KCPrescriptionPrintTemplate.php<\/code><\/td><td>PDF<\/td><\/tr><tr><td><code>PrescriptionEmailTable.php<\/code><\/td><td>kivicare-clinic-management-system<\/td><td><em>(hook-based, see below)<\/em><\/td><td>HTML email<\/td><\/tr><tr><td><code>html-kc-dashboard.php<\/code><\/td><td>kivicare-clinic-management-system<\/td><td><em>(hook-based, see below)<\/em><\/td><td>Dashboard HTML shell<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"template-1--appointment-invoice-kcinvoiceprinttemplatephp\">Template 1 \u2014 Appointment Invoice (<code>KCInvoicePrintTemplate.php<\/code>)<\/h2>\n\n\n\n<p><strong>Plugin:<\/strong>&nbsp;<code>kivicare-clinic-management-system<\/code><br><strong>Source:<\/strong>&nbsp;<code>wp-content\/plugins\/kivicare-clinic-management-system\/templates\/KCInvoicePrintTemplate.php<\/code><br><strong>Override path:<\/strong>&nbsp;<code>your-child-theme\/kivicare\/KCInvoicePrintTemplate.php<\/code><br><strong>Triggered by:<\/strong>&nbsp;REST endpoint&nbsp;<code>GET \/wp-json\/kivicare\/v1\/appointments\/{id}\/print-invoice<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"available-variables\">Available Variables<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Variable<\/th><th class=\"has-text-align-left\" data-align=\"left\">Type<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><\/thead><tbody><tr><td><code>$appointment<\/code><\/td><td><code>array<\/code><\/td><td><code>id<\/code>,&nbsp;<code>appointmentStartDate<\/code>,&nbsp;<code>appointmentStartTime<\/code>,&nbsp;<code>paymentMode<\/code>,&nbsp;<code>paymentStatus<\/code><\/td><\/tr><tr><td><code>$patient<\/code><\/td><td><code>array|null<\/code><\/td><td><code>name<\/code>,&nbsp;<code>email<\/code>,&nbsp;<code>phone<\/code>,&nbsp;<code>address<\/code>,&nbsp;<code>city<\/code>,&nbsp;<code>country<\/code>,&nbsp;<code>postal_code<\/code>,&nbsp;<code>gender<\/code>,&nbsp;<code>age<\/code>,&nbsp;<code>id<\/code><\/td><\/tr><tr><td><code>$doctor<\/code><\/td><td><code>array|null<\/code><\/td><td><code>name<\/code>,&nbsp;<code>email<\/code>,&nbsp;<code>specialization<\/code>,&nbsp;<code>signature<\/code><\/td><\/tr><tr><td><code>$clinic<\/code><\/td><td><code>array|null<\/code><\/td><td><code>name<\/code>,&nbsp;<code>address<\/code>,&nbsp;<code>city<\/code>,&nbsp;<code>country<\/code>,&nbsp;<code>postal_code<\/code>,&nbsp;<code>phone<\/code>,&nbsp;<code>email<\/code>,&nbsp;<code>logo<\/code><\/td><\/tr><tr><td><code>$clinic_logo<\/code><\/td><td><code>array<\/code><\/td><td><code>id<\/code>,&nbsp;<code>url<\/code>&nbsp;\u2014 the clinic logo attachment<\/td><\/tr><tr><td><code>$services<\/code><\/td><td><code>array<\/code><\/td><td>Each item:&nbsp;<code>name<\/code>,&nbsp;<code>charges<\/code>&nbsp;(float)<\/td><\/tr><tr><td><code>$tax_items<\/code><\/td><td><code>array<\/code><\/td><td>Result of&nbsp;<code>apply_filters('kivicare_get_tax_data', $appointment_id)<\/code>&nbsp;\u2014 contains&nbsp;<code>tax_data[]<\/code>&nbsp;with&nbsp;<code>tax_name<\/code>,&nbsp;<code>tax_amount<\/code><\/td><\/tr><tr><td><code>$currency_prefix<\/code><\/td><td><code>string<\/code><\/td><td>Currency symbol placed before the amount (e.g.&nbsp;<code>$<\/code>)<\/td><\/tr><tr><td><code>$currency_postfix<\/code><\/td><td><code>string<\/code><\/td><td>Currency symbol placed after the amount (e.g.&nbsp;<code>USD<\/code>)<\/td><\/tr><tr><td><code>$total_charges<\/code><\/td><td><code>string<\/code><\/td><td>Pre-formatted subtotal string (<code>number_format<\/code>)<\/td><\/tr><tr><td><code>$sub_total<\/code><\/td><td><code>float<\/code><\/td><td>Raw subtotal float for calculations<\/td><\/tr><tr><td><code>$appointmentReport<\/code><\/td><td><code>array<\/code><\/td><td>Attached documents \u2014 each item:&nbsp;<code>id<\/code>,&nbsp;<code>url<\/code>,&nbsp;<code>filename<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mpdf-constraints\">mPDF Constraints<\/h3>\n\n\n\n<p>This template is rendered by mPDF. Keep these in mind when customising:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>No\u00a0<code>* { box-sizing: border-box }<\/code>\u00a0\u2014 unsupported by mPDF.<\/li>\n\n\n\n<li>No\u00a0<code>border-radius<\/code>\u00a0on inline\/span elements \u2014 it is silently ignored.<\/li>\n\n\n\n<li>Use\u00a0<code>&lt;table&gt;<\/code>\u00a0for multi-column layouts, not\u00a0<code>float<\/code>\u00a0or\u00a0<code>flexbox<\/code>.<\/li>\n\n\n\n<li>The\u00a0<code>&lt;!-- NO_SIMPLE_TABLES --&gt;<\/code>\u00a0comment at the top of\u00a0<code>&lt;body&gt;<\/code>\u00a0is required to allow\u00a0<code>background<\/code>\u00a0on\u00a0<code>&lt;th&gt;<\/code>\u00a0elements.<\/li>\n\n\n\n<li>The font stack must include\u00a0<code>DejaVu Sans<\/code>\u00a0as the primary font for Unicode\/multi-language support.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"override-steps\">Override Steps<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p wp-content\/themes\/your-child-theme\/kivicare\ncp wp-content\/plugins\/kivicare-clinic-management-system\/templates\/KCInvoicePrintTemplate.php \\\n   wp-content\/themes\/your-child-theme\/kivicare\/KCInvoicePrintTemplate.php\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"common-customisations\">Common Customisations<\/h3>\n\n\n\n<p><strong>Change accent colour<\/strong>&nbsp;\u2014 find all occurrences of&nbsp;<code>#5F60B9<\/code>&nbsp;in the&nbsp;<code>&lt;style&gt;<\/code>&nbsp;block and replace with your brand colour.<\/p>\n\n\n\n<p><strong>Add a custom logo<\/strong>&nbsp;\u2014 replace the logo block:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;img src=\"&lt;?php echo esc_url($clinic&#091;'logo']); ?&gt;\" style=\"height: 60px;\"&gt;\n<\/code><\/pre>\n\n\n\n<p>with a hard-coded path:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;img src=\"&lt;?php echo esc_url(get_stylesheet_directory_uri()); ?&gt;\/assets\/my-logo.png\" style=\"height: 60px;\"&gt;\n<\/code><\/pre>\n\n\n\n<p><strong>Change payment status colours:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em>\/\/ Paid  \u2192 change #219653<\/em>\n<em>\/\/ Unpaid \u2192 change #dc2626<\/em>\n$paymentStatusColor = strtolower($paymentStatus) === 'paid' ? '#YOUR_COLOR' : '#YOUR_COLOR';\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"template-2--encounter-bill--invoice-kcbillprinttemplatephp\">Template 2 \u2014 Encounter Bill \/ Invoice (<code>KCBillPrintTemplate.php<\/code>)<\/h2>\n\n\n\n<p><strong>Plugin:<\/strong>&nbsp;<code>kivicare-pro<\/code><br><strong>Source:<\/strong>&nbsp;<code>wp-content\/plugins\/kivicare-pro\/templates\/KCBillPrintTemplate.php<\/code><br><strong>Override path:<\/strong>&nbsp;<code>your-child-theme\/kivicare\/KCBillPrintTemplate.php<\/code><br><strong>Triggered by:<\/strong>&nbsp;Bill print action in the Encounters module (KiviCare Pro)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"available-variables-1\">Available Variables<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Variable<\/th><th class=\"has-text-align-left\" data-align=\"left\">Type<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><\/thead><tbody><tr><td><code>$bill<\/code><\/td><td><code>array<\/code><\/td><td><code>id<\/code>,&nbsp;<code>invoice_id<\/code>,&nbsp;<code>date<\/code>,&nbsp;<code>status<\/code>,&nbsp;<code>discount<\/code>,&nbsp;<code>actual_amount<\/code><\/td><\/tr><tr><td><code>$patient<\/code><\/td><td><code>array<\/code><\/td><td><code>id<\/code>,&nbsp;<code>name<\/code>,&nbsp;<code>dob<\/code>,&nbsp;<code>phone<\/code><\/td><\/tr><tr><td><code>$doctor<\/code><\/td><td><code>array<\/code><\/td><td><code>name<\/code><\/td><\/tr><tr><td><code>$clinic<\/code><\/td><td><code>array<\/code><\/td><td><code>name<\/code>,&nbsp;<code>address<\/code>,&nbsp;<code>city<\/code>,&nbsp;<code>country<\/code>,&nbsp;<code>postal_code<\/code>,&nbsp;<code>phone<\/code>,&nbsp;<code>email<\/code><\/td><\/tr><tr><td><code>$clinic_logo<\/code><\/td><td><code>array<\/code><\/td><td><code>id<\/code>,&nbsp;<code>url<\/code><\/td><\/tr><tr><td><code>$service_items<\/code><\/td><td><code>array<\/code><\/td><td>Each item:&nbsp;<code>name<\/code>,&nbsp;<code>price<\/code>,&nbsp;<code>total<\/code><\/td><\/tr><tr><td><code>$tax_items<\/code><\/td><td><code>array<\/code><\/td><td>Each item:&nbsp;<code>name<\/code>,&nbsp;<code>charges<\/code><\/td><\/tr><tr><td><code>$currency_detail<\/code><\/td><td><code>array<\/code><\/td><td><code>prefix<\/code>,&nbsp;<code>postfix<\/code><\/td><\/tr><tr><td><code>$payment_method<\/code><\/td><td><code>string<\/code><\/td><td>Payment method label (e.g.&nbsp;<code>Cash<\/code>,&nbsp;<code>Card<\/code>)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"helper-functions-defined-in-template\">Helper Functions (defined in template)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>money($amount, $currency_detail)  <em>\/\/ formats a float with currency prefix\/postfix<\/em>\ncalc_age($dob)                     <em>\/\/ returns age string from date-of-birth<\/em>\n<\/code><\/pre>\n\n\n\n<p>These are defined inside the template file itself. If you override the template, keep or redefine them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"override-steps-1\">Override Steps<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p wp-content\/themes\/your-child-theme\/kivicare\ncp wp-content\/plugins\/kivicare-pro\/templates\/KCBillPrintTemplate.php \\\n   wp-content\/themes\/your-child-theme\/kivicare\/KCBillPrintTemplate.php\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mpdf-constraints-1\">mPDF Constraints<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Multi-column header uses\u00a0<code>&lt;table&gt;<\/code>\u00a0layout (not floats).<\/li>\n\n\n\n<li><code>background<\/code>\u00a0on\u00a0<code>&lt;th&gt;<\/code>\u00a0requires the\u00a0<code>.services<\/code>\u00a0class combined with mPDF&#8217;s\u00a0<code>simpleTables=false<\/code>\u00a0mode \u2014 do not remove the\u00a0<code>class=\"services\"<\/code>\u00a0attribute from service tables.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"template-3--patient-encounter-kcencounterprinttemplatephp\">Template 3 \u2014 Patient Encounter (<code>KCEncounterPrintTemplate.php<\/code>)<\/h2>\n\n\n\n<p><strong>Plugin:<\/strong>&nbsp;<code>kivicare-pro<\/code><br><strong>Source:<\/strong>&nbsp;<code>wp-content\/plugins\/kivicare-pro\/templates\/KCEncounterPrintTemplate.php<\/code><br><strong>Override path:<\/strong>&nbsp;<code>your-child-theme\/kivicare\/KCEncounterPrintTemplate.php<\/code><br><strong>Triggered by:<\/strong>&nbsp;Encounter print action in the Encounters module (KiviCare Pro)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"available-variables-2\">Available Variables<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Variable<\/th><th class=\"has-text-align-left\" data-align=\"left\">Type<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><\/thead><tbody><tr><td><code>$encounter<\/code><\/td><td><code>array<\/code><\/td><td><code>created_at<\/code><\/td><\/tr><tr><td><code>$patient<\/code><\/td><td><code>array<\/code><\/td><td><code>name<\/code>,&nbsp;<code>email<\/code>,&nbsp;<code>address<\/code>,&nbsp;<code>city<\/code>,&nbsp;<code>postal_code<\/code>,&nbsp;<code>country<\/code><\/td><\/tr><tr><td><code>$doctor<\/code><\/td><td><code>array<\/code><\/td><td><code>name<\/code>,&nbsp;<code>specialization<\/code>,&nbsp;<code>signature<\/code><\/td><\/tr><tr><td><code>$clinic<\/code><\/td><td><code>array<\/code><\/td><td><code>name<\/code>,&nbsp;<code>address<\/code>,&nbsp;<code>city<\/code>,&nbsp;<code>country<\/code>,&nbsp;<code>postal_code<\/code>,&nbsp;<code>phone<\/code>,&nbsp;<code>email<\/code><\/td><\/tr><tr><td><code>$clinic_logo<\/code><\/td><td><code>array<\/code><\/td><td><code>id<\/code>,&nbsp;<code>url<\/code><\/td><\/tr><tr><td><code>$medical_history<\/code><\/td><td><code>array|null<\/code><\/td><td><code>problem[]<\/code>,&nbsp;<code>observation[]<\/code>,&nbsp;<code>note[]<\/code>&nbsp;\u2014 each item has a&nbsp;<code>title<\/code>&nbsp;key<\/td><\/tr><tr><td><code>$prescriptions<\/code><\/td><td><code>array<\/code><\/td><td>Each item:&nbsp;<code>name<\/code>,&nbsp;<code>frequency<\/code>,&nbsp;<code>duration<\/code>,&nbsp;<code>instruction<\/code><\/td><\/tr><tr><td><code>$custom_fields<\/code><\/td><td><code>array<\/code><\/td><td>Each item:&nbsp;<code>label<\/code>,&nbsp;<code>value<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"override-steps-2\">Override Steps<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p wp-content\/themes\/your-child-theme\/kivicare\ncp wp-content\/plugins\/kivicare-pro\/templates\/KCEncounterPrintTemplate.php \\\n   wp-content\/themes\/your-child-theme\/kivicare\/KCEncounterPrintTemplate.php\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sections-in-the-template\">Sections in the Template<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Section<\/th><th class=\"has-text-align-left\" data-align=\"left\">Conditional<\/th><th class=\"has-text-align-left\" data-align=\"left\">Notes<\/th><\/tr><\/thead><tbody><tr><td>Header (logo, clinic, doctor, patient info)<\/td><td>Always shown<\/td><td><\/td><\/tr><tr><td>Clinical Details<\/td><td>Only if&nbsp;<code>$medical_history<\/code>&nbsp;not empty<\/td><td>Problems, Observations, Notes<\/td><\/tr><tr><td>Prescription<\/td><td>Only if&nbsp;<code>$prescriptions<\/code>&nbsp;not empty<\/td><td><\/td><\/tr><tr><td>Custom Fields<\/td><td>Only if&nbsp;<code>$custom_fields<\/code>&nbsp;not empty<\/td><td><\/td><\/tr><tr><td>Doctor Signature<\/td><td>Shows image if&nbsp;<code>$doctor['signature']<\/code>&nbsp;set, else blank line<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"template-4--prescription-print-kcprescriptionprinttemplatephp\">Template 4 \u2014 Prescription Print (<code>KCPrescriptionPrintTemplate.php<\/code>)<\/h2>\n\n\n\n<p><strong>Plugin:<\/strong>&nbsp;<code>kivicare-pro<\/code><br><strong>Source:<\/strong>&nbsp;<code>wp-content\/plugins\/kivicare-pro\/templates\/KCPrescriptionPrintTemplate.php<\/code><br><strong>Override path:<\/strong>&nbsp;<code>your-child-theme\/kivicare\/KCPrescriptionPrintTemplate.php<\/code><br><strong>Triggered by:<\/strong>&nbsp;Prescription print action from Encounter detail<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"available-variables-3\">Available Variables<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Variable<\/th><th class=\"has-text-align-left\" data-align=\"left\">Type<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><\/thead><tbody><tr><td><code>$encounter<\/code><\/td><td><code>array<\/code><\/td><td><code>encounter_date<\/code><\/td><\/tr><tr><td><code>$patient<\/code><\/td><td><code>array<\/code><\/td><td><code>name<\/code>,&nbsp;<code>email<\/code>,&nbsp;<code>blood_group<\/code>,&nbsp;<code>gender<\/code><\/td><\/tr><tr><td><code>$doctor<\/code><\/td><td><code>array<\/code><\/td><td><code>name<\/code>,&nbsp;<code>specialization<\/code>,&nbsp;<code>signature<\/code><\/td><\/tr><tr><td><code>$clinic<\/code><\/td><td><code>array<\/code><\/td><td><code>name<\/code>,&nbsp;<code>address<\/code>,&nbsp;<code>city<\/code>,&nbsp;<code>country<\/code>,&nbsp;<code>postal_code<\/code>,&nbsp;<code>phone<\/code>,&nbsp;<code>email<\/code><\/td><\/tr><tr><td><code>$clinic_logo<\/code><\/td><td><code>array<\/code><\/td><td><code>id<\/code>,&nbsp;<code>url<\/code><\/td><\/tr><tr><td><code>$prescriptions<\/code><\/td><td><code>array<\/code><\/td><td>Each item:&nbsp;<code>name<\/code>,&nbsp;<code>frequency<\/code>,&nbsp;<code>duration<\/code>,&nbsp;<code>instruction<\/code><\/td><\/tr><tr><td><code>$clinical_details<\/code><\/td><td><code>array|null<\/code><\/td><td><code>problems[]<\/code>,&nbsp;<code>observations[]<\/code>,&nbsp;<code>notes[]<\/code>&nbsp;\u2014 each item has&nbsp;<code>title<\/code><\/td><\/tr><tr><td><code>$custom_fields<\/code><\/td><td><code>array<\/code><\/td><td>Each item:&nbsp;<code>label<\/code>,&nbsp;<code>value<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"override-steps-3\">Override Steps<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p wp-content\/themes\/your-child-theme\/kivicare\ncp wp-content\/plugins\/kivicare-pro\/templates\/KCPrescriptionPrintTemplate.php \\\n   wp-content\/themes\/your-child-theme\/kivicare\/KCPrescriptionPrintTemplate.php\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mpdf-constraints-2\">mPDF Constraints<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The\u00a0<code>&lt;!-- NO_SIMPLE_TABLES --&gt;<\/code>\u00a0comment in\u00a0<code>&lt;body&gt;<\/code>\u00a0is required for\u00a0<code>&lt;th&gt;<\/code>\u00a0background colours to render.<\/li>\n\n\n\n<li>Use\u00a0<code>margin-left<\/code>\u00a0(not\u00a0<code>padding-left<\/code>) for\u00a0<code>&lt;ul&gt;<\/code>\u00a0indentation inside table cells.<\/li>\n\n\n\n<li><code>border-radius<\/code>\u00a0on\u00a0<code>.logo<\/code>\u00a0is silently ignored by mPDF \u2014 do not rely on it.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"template-5--prescription-email-table-prescriptionemailtablephp\">Template 5 \u2014 Prescription Email Table (<code>PrescriptionEmailTable.php<\/code>)<\/h2>\n\n\n\n<p><strong>Plugin:<\/strong>&nbsp;<code>kivicare-clinic-management-system<\/code><br><strong>Source:<\/strong>&nbsp;<code>wp-content\/plugins\/kivicare-clinic-management-system\/templates\/PrescriptionEmailTable.php<\/code><br><strong>Override path:<\/strong>&nbsp;<strong>No built-in child theme override.<\/strong>&nbsp;Use the WordPress filter below.<\/p>\n\n\n\n<p>This template renders the&nbsp;<code>&lt;table&gt;<\/code>&nbsp;HTML that is embedded inside the prescription notification email. It is loaded directly by&nbsp;<code>PrescriptionController<\/code>&nbsp;without a theme lookup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"available-variables-4\">Available Variables<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Variable<\/th><th class=\"has-text-align-left\" data-align=\"left\">Type<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><\/thead><tbody><tr><td><code>$prescriptions<\/code><\/td><td><code>array<\/code>&nbsp;of objects<\/td><td>Each object has:&nbsp;<code>name<\/code>,&nbsp;<code>frequency<\/code>,&nbsp;<code>duration<\/code>,&nbsp;<code>instruction<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-override-filter-based\">How to Override (Filter-Based)<\/h3>\n\n\n\n<p>Since there is no child theme path, intercept the email HTML with a WordPress filter in your child theme&#8217;s&nbsp;<code>functions.php<\/code>&nbsp;or a custom plugin:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter('kivicare_prescription_email_html', function( string $html, array $prescriptions ): string {\n    ob_start();\n    <em>\/\/ your custom table markup here, using $prescriptions<\/em>\n    foreach ( $prescriptions as $p ) {\n        echo '&lt;tr&gt;&lt;td&gt;' . esc_html( $p-&gt;name ) . '&lt;\/td&gt;...&lt;\/tr&gt;';\n    }\n    return ob_get_clean();\n}, 10, 2);\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Note:<\/strong>&nbsp;If the filter&nbsp;<code>kivicare_prescription_email_html<\/code>&nbsp;does not yet exist in the plugin&#8217;s source, the alternative is to copy the template into a mu-plugin or custom plugin and include it via a hooked function that replaces the email body before sending.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"template-6--dashboard-html-shell-html-kc-dashboardphp\">Template 6 \u2014 Dashboard HTML Shell (<code>html-kc-dashboard.php<\/code>)<\/h2>\n\n\n\n<p><strong>Plugin:<\/strong>&nbsp;<code>kivicare-clinic-management-system<\/code><br><strong>Source:<\/strong>&nbsp;<code>wp-content\/plugins\/kivicare-clinic-management-system\/templates\/html-kc-dashboard.php<\/code><br><strong>Override path:<\/strong>&nbsp;<strong>No built-in child theme override.<\/strong>&nbsp;Use WordPress hooks below.<\/p>\n\n\n\n<p>This is the full HTML shell (doctype \u2192&nbsp;<code>&lt;\/html&gt;<\/code>) for the KiviCare SPA dashboard. The React app mounts into&nbsp;<code>&lt;div id=\"kc-dashboard\"&gt;<\/code>. It is loaded via WordPress&#8217;s&nbsp;<code>template_include<\/code>&nbsp;filter by&nbsp;<code>KCDashboardPermalinkHandler<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-it-controls\">What It Controls<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Feature<\/th><th class=\"has-text-align-left\" data-align=\"left\">How it works<\/th><\/tr><\/thead><tbody><tr><td>Dark \/ light mode<\/td><td><code>data-bs-theme<\/code>&nbsp;attribute on&nbsp;<code>&lt;html&gt;<\/code>, driven by&nbsp;<code>KCOption::get('dark_mode')<\/code><\/td><\/tr><tr><td>RTL \/ LTR<\/td><td><code>dir<\/code>&nbsp;attribute on&nbsp;<code>&lt;html&gt;<\/code>, driven by&nbsp;<code>is_rtl()<\/code>&nbsp;and&nbsp;<code>KCOption::get('theme_mode')<\/code><\/td><\/tr><tr><td>Custom fonts<\/td><td>Google Fonts&nbsp;<code>&lt;link&gt;<\/code>&nbsp;injected when title\/body font differs from&nbsp;<code>Inter<\/code><\/td><\/tr><tr><td>Brand colours<\/td><td>CSS custom properties (<code>--bs-primary<\/code>,&nbsp;<code>--bs-secondary<\/code>, etc.) output from&nbsp;<code>KCOption::get('generated_colors')<\/code><\/td><\/tr><tr><td>React mount point<\/td><td><code>&lt;div id=\"kc-dashboard\"&gt;&lt;\/div&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"available-variables-5\">Available Variables<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Variable<\/th><th class=\"has-text-align-left\" data-align=\"left\">Type<\/th><th class=\"has-text-align-left\" data-align=\"left\">Description<\/th><\/tr><\/thead><tbody><tr><td><code>$dashboard_config<\/code><\/td><td><code>array<\/code><\/td><td>Theme, layout, sidebar, RTL, dark mode, user role \u2014 passed to&nbsp;<code>kivicare_dashboard_config<\/code>&nbsp;filter<\/td><\/tr><tr><td><code>$dark_mode<\/code><\/td><td><code>bool<\/code><\/td><td>Whether dark mode is active for this user<\/td><\/tr><tr><td><code>$titleFont<\/code><\/td><td><code>string<\/code><\/td><td>Title font name from clinic settings<\/td><\/tr><tr><td><code>$bodyFont<\/code><\/td><td><code>string<\/code><\/td><td>Body font name from clinic settings<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"extension-hooks\">Extension Hooks<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><em>\/\/ Add content to &lt;head&gt; (scripts, meta tags, custom CSS)<\/em>\nadd_action('kivicare_dashboard_head', function( array $config ) {\n    echo '&lt;link rel=\"stylesheet\" href=\"...\"&gt;';\n}, 10, 1);\n\n<em>\/\/ Add content before &lt;\/body&gt; (tracking scripts, overlays)<\/em>\nadd_action('kivicare_dashboard_footer', function( array $config ) {\n    echo '&lt;script&gt;...&lt;\/script&gt;';\n}, 10, 1);\n\n<em>\/\/ Runs after wp_footer(), last hook before &lt;\/body&gt;<\/em>\nadd_action('kivicare_dashboard_end', function() {\n    <em>\/\/ cleanup or injections<\/em>\n});\n\n<em>\/\/ Modify dashboard config before it is applied<\/em>\nadd_filter('kivicare_dashboard_config', function( array $config ): array {\n    $config&#091;'theme'] = 'dark';\n    return $config;\n});\n\n<em>\/\/ Modify the page title<\/em>\nadd_filter('kivicare_dashboard_title', function( string $title, string $role ): string {\n    return 'My Clinic \u2014 ' . $title;\n}, 10, 2);\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"language--translation\">Language \/ Translation<\/h2>\n\n\n\n<p>All string labels in every template use&nbsp;<code>__()<\/code>&nbsp;or&nbsp;<code>esc_html__()<\/code>&nbsp;with the appropriate text domain:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Core templates \u2192 text domain:\u00a0<code>kivicare-clinic-management-system<\/code><\/li>\n\n\n\n<li>Pro templates \u2192 text domain:\u00a0<code>kivicare-pro<\/code><\/li>\n<\/ul>\n\n\n\n<p>To change the language of printed documents:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Method<\/th><th class=\"has-text-align-left\" data-align=\"left\">Scope<\/th><\/tr><\/thead><tbody><tr><td><strong>Settings \u2192 General \u2192 Site Language<\/strong><\/td><td>All users site-wide<\/td><\/tr><tr><td><strong>User Profile \u2192 Language<\/strong><\/td><td>Per-user (affects that user&#8217;s downloaded PDFs)<\/td><\/tr><tr><td>Edit strings directly in your overridden template<\/td><td>Per-template, locale-independent<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"tips\">Tips<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Test with a real PDF download<\/strong>\u00a0after every change \u2014 mPDF silently ignores unsupported CSS rather than erroring.<\/li>\n\n\n\n<li>The PDF font is\u00a0<code>DejaVu Sans<\/code>. For languages that require complex script shaping (e.g. Arabic, Gujarati, Hindi), ensure\u00a0<code>autoLangToFont<\/code>\u00a0and\u00a0<code>autoScriptToLang<\/code>\u00a0remain enabled in the PDF config (they are on by default in the invoice controller).<\/li>\n\n\n\n<li>Keep the\u00a0<code>&lt;!-- NO_SIMPLE_TABLES --&gt;<\/code>\u00a0HTML comment in templates that use background colours on\u00a0<code>&lt;th&gt;<\/code>\u00a0\u2014 removing it will cause header backgrounds to disappear.<\/li>\n\n\n\n<li>All override templates support the standard\u00a0<code>esc_html()<\/code>,\u00a0<code>esc_url()<\/code>, and\u00a0<code>esc_attr()<\/code>\u00a0escaping functions \u2014 use them on every output to stay XSS-safe.<\/li>\n<\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>This article covers every overridable template in&nbsp;KiviCare&nbsp;(core) and&nbsp;KiviCare Pro, where each template lives, what data variables it receives, and how to safely override it from your child theme without touching plugin files. How the Override System Works All print\/PDF templates use a three-level lookup \u2014 the first file found wins: Rule:&nbsp;Never edit files inside&nbsp;wp-content\/plugins\/. Copy [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"parent":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-3355","post","type-post","status-publish","format-standard","hentry","category-features"],"featured_image_src":null,"author_info":{"display_name":"wordpressadminiq","author_link":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/author\/wordpressadminiq\/"},"_links":{"self":[{"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/posts\/3355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/comments?post=3355"}],"version-history":[{"count":1,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/posts\/3355\/revisions"}],"predecessor-version":[{"id":3356,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/posts\/3355\/revisions\/3356"}],"wp:attachment":[{"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/media?parent=3355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/categories?post=3355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/tags?post=3355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}