Title: Order ID Code
Last modified: March 9, 2019

---

# Order ID Code

 *  Resolved [Bob](https://wordpress.org/support/users/orionlearn/)
 * (@orionlearn)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/order-id-code/)
 * Trying to add an my Woo ‘Order ID’ to the simple template. I tried order_id and
   get_id but it does not work and really messes up the template.
 * Here is the code I inserted
 * <tr
    class=”order-id”><th><?php _e( ‘Order ID:’, ‘woocommerce-pdf-invoices-packing-
   slips’ ); ?></th><td><?php $this->order_id(); ?></td> </tr>
 * Any help is appreciated

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/order-id-code/#post-11295030)
 * These both work:
 *     ```
       <?php echo $order_id; ?>
       ```
   
 *     ```
       <?php echo $order->get_id(); ?>
       ```
   
 *  Thread Starter [Bob](https://wordpress.org/support/users/orionlearn/)
 * (@orionlearn)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/order-id-code/#post-11295249)
 * Thanks!
 * They did not bring in the order ID. The field is blank.
 * I tried both and they do not disrupt the PDF, but no data in the field
 * Here is my code:
 * </tr>
    <tr class=”order_id”><th><?php _e( ‘Order ID:’, ‘woocommerce-pdf-invoices-
   packing-slips’ ); ?></th><td><&It;?php echo $order->get_id(); ?>></td> </tr>
 * Bob
 *  Thread Starter [Bob](https://wordpress.org/support/users/orionlearn/)
 * (@orionlearn)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/order-id-code/#post-11295292)
 * Hey, Solved my own error in the code when I saw it on the post. Works perfectly!
   Thanks!! Appreciate the help.
 * For anyone else, here is the correct code:
 * <tr class=”order_id”><th><?php _e( ‘Order ID:’, ‘woocommerce-pdf-invoices-packing-
   slips’ ); ?></th><td><?php echo $order->get_id(); ?></td>
    </tr>

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Order ID Code’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

## Tags

 * [order id](https://wordpress.org/support/topic-tag/order-id/)

 * 3 replies
 * 2 participants
 * Last reply from: [Bob](https://wordpress.org/support/users/orionlearn/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/order-id-code/#post-11295292)
 * Status: resolved