Hi @diegpl,
I’m assuming you want the order status to show on the packing slip. You can achieve that with the following code snippet, which should also work for custom order statuses.
add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_add_order_status_to_packing_slip', 10, 2 );
function wpo_wcpdf_add_order_status_to_packing_slip( $document_type, $order ) {
if ( $document_type == 'packing-slip' ) {
foreach ( wc_get_order_statuses() as $id => $name ) {
if ( strpos( $id, $order->get_status() ) !== false ) {
?>
<tr class="order-status">
<th>Order status:</th>
<td><?php echo $name; ?></td>
</tr>
<?php
}
}
}
}
This code snippet should be added to the functions.php of your child theme or via a plugin like Code Snippets. If you haven’t worked with code snippets before please read the following: How to use filters