HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1014-azure #14~24.04.1-Ubuntu SMP Fri Oct 3 20:52:11 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/doccure-wp-market/wp-content/themes/doccure/woocommerce/print-order.php
<?php 
if (!defined('ABSPATH')) {
    exit;
}

if (isset($_GET['print-order']) && wp_verify_nonce($_REQUEST['_wpnonce'], 'woocommerce_print_order')) {
    $order_id = absint($_GET['print-order']);
    $order = wc_get_order($order_id);

    if ($order) {
        // Display order details here
        ?>
        <!DOCTYPE html>
        <html <?php language_attributes(); ?>>
        <head>
            <meta charset="<?php bloginfo('charset'); ?>">
            <?php 
            add_theme_support( 'title-tag' );

            add_action( 'woocommerce_page_title', 'doccure_print_order_title' );
            function doccure_print_order_title() {
                return esc_html__( 'Print Order', 'doccure' );
            }
            ?>
            <style>
                body { font-family: Arial, sans-serif; }
                .order-details { width: 100%; }
                .order-details th, .order-details td { padding: 10px; border: 1px solid #ddd; }
            </style>
        </head>
        <body>
            <h1><?php esc_html_e('Order Details', 'doccure'); ?></h1>
            <table class="order-details">
                <tr>
                    <th><?php esc_html_e('Product', 'doccure'); ?></th>
                    <th><?php esc_html_e('Quantity', 'doccure'); ?></th>
                    <th><?php esc_html_e('Total', 'doccure'); ?></th>
                </tr>
                <?php
                foreach ($order->get_items() as $item_id => $item) {
                    $product = $item->get_product();
                    ?>
                    <tr>
                        <td><?php echo esc_html($product->get_name()); ?></td>
                        <td><?php echo esc_html($item->get_quantity()); ?></td>
                        <td><?php echo esc_html($order->get_formatted_line_subtotal($item)); ?></td>
                    </tr>
                    <?php
                }
                ?>
            </table>
            
        </body>
        </html>
        <?php
        exit;
    }
}
?>