getTemplate() : 'standard';
if (empty($current_template)) {
$current_template = 'standard';
}
$template_class = 'template-' . $current_template;
// Initialize formatter for the invoice templates
$formatter = new \EasyInvoice\Helpers\InvoiceFormatter($invoice);
?>
getId(), '_easy_invoice_invoice_template', true);
if ($template_id && class_exists('\EasyInvoicePro\TemplateParser') && class_exists('\EasyInvoicePro\Controllers\TemplateBuilderController')) {
$templateData = \EasyInvoicePro\TemplateParser::parseTemplateFromDatabase($template_id);
if ($templateData && isset($templateData['elements'])) {
echo '';
}
}
}
// Dynamically load the selected template
$template_file = EASY_INVOICE_PLUGIN_DIR . 'templates/invoice-templates/' . $current_template . '.php';
$template_file = file_exists($template_file) ? $template_file : EASY_INVOICE_PLUGIN_DIR . 'templates/invoice-templates/default.php';
if (file_exists($template_file)) {
include_once $template_file;
} else {
// Show template not found message
?>
Template Not Found
The selected template "" does not exist.
Please select a different template or contact support if you believe this is an error.