ajout email et tel ds email error

This commit is contained in:
Jean-Philippe Staelen 2025-12-16 15:29:01 +01:00
parent 4c15f09dad
commit 7c24654741

View File

@ -30,6 +30,8 @@ $site_url = home_url();
$order = wc_get_order($order_id); $order = wc_get_order($order_id);
$order_total = ''; $order_total = '';
$customer_name = ''; $customer_name = '';
$customer_email = '';
$customer_phone = '';
if ($order instanceof WC_Order) { if ($order instanceof WC_Order) {
$order_total = $order->get_formatted_order_total(); $order_total = $order->get_formatted_order_total();
$first_name = $order->get_billing_first_name(); $first_name = $order->get_billing_first_name();
@ -37,6 +39,8 @@ if ($order instanceof WC_Order) {
if (!empty($first_name) || !empty($last_name)) { if (!empty($first_name) || !empty($last_name)) {
$customer_name = trim($first_name . ' ' . $last_name); $customer_name = trim($first_name . ' ' . $last_name);
} }
$customer_email = $order->get_billing_email();
$customer_phone = $order->get_billing_phone();
} }
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@ -171,6 +175,14 @@ if ($order instanceof WC_Order) {
<strong><?php esc_html_e('Client:', 'esi_peppol'); ?></strong> <strong><?php esc_html_e('Client:', 'esi_peppol'); ?></strong>
<?php echo esc_html($customer_name); ?><br> <?php echo esc_html($customer_name); ?><br>
<?php endif; ?> <?php endif; ?>
<?php if (!empty($customer_email)) : ?>
<strong><?php esc_html_e('Email:', 'esi_peppol'); ?></strong>
<?php echo esc_html($customer_email); ?><br>
<?php endif; ?>
<?php if (!empty($customer_phone)) : ?>
<strong><?php esc_html_e('Téléphone:', 'esi_peppol'); ?></strong>
<?php echo esc_html($customer_phone); ?><br>
<?php endif; ?>
<?php if (!empty($order_total)) : ?> <?php if (!empty($order_total)) : ?>
<strong><?php esc_html_e('Total:', 'esi_peppol'); ?></strong> <strong><?php esc_html_e('Total:', 'esi_peppol'); ?></strong>
<?php echo $order_total; ?> <?php echo $order_total; ?>