function wc_gzdp_invoice_download_html($order_id) { $order = wc_get_order($order_id); global $invoices; $invoices = wc_gzdp_get_invoices_by_order($order); foreach ($invoices as $key => $invoice) { if (!in_array($invoice->type, wc_gzdp_get_invoice_frontend_types())) { unset($invoices[$key]); } } $invoices = array_values($invoices); if (!empty($invoices)) { wc_get_template('invoice/download.php'); } }
public function load_invoice_module() { add_action('after_setup_theme', array($this, 'add_query_vars')); add_action('after_setup_theme', array($this, 'include_invoice_template_functions'), 12); add_action('init', array($this, 'init_invoice_module'), 1); include_once 'includes/abstracts/abstract-wc-gzdp-invoice.php'; include_once 'includes/wc-gzdp-invoice-functions.php'; include_once 'includes/class-wc-gzdp-invoice-helper.php'; include_once 'includes/class-wc-gzdp-invoice-shortcodes.php'; include_once 'includes/class-wc-gzdp-download-handler.php'; if ((!is_admin() || defined('DOING_AJAX')) && wc_gzdp_get_invoice_frontend_types()) { include_once 'includes/wc-gzdp-invoice-template-hooks.php'; } // Post types include_once 'includes/class-wc-gzdp-post-types.php'; }