request('/woo/api/invoice/list', ['customer_id' => get_current_user_id()]); $invoices = $result['success'] ? ($result['data']['invoices'] ?? []) : []; // Also pull locally stored invoices from WC orders $wc_orders = wc_get_orders([ 'customer' => get_current_user_id(), 'limit' => 50, 'meta_key' => '_odoo_invoice_pdf', ]); ?>

get_id(), array_column($invoices, 'wc_order_id'))) continue; $has_pdf = !empty($order->get_meta('_odoo_invoice_pdf')); if (!$has_pdf) continue; ?>
get_order_number()); ?> get_date_created() ? $order->get_date_created()->date_i18n('Y-m-d') : '—'); ?> get_total(), 2); ?> get_status())); ?>