• Love the plugin, but I would like to add order status to packing slips. Is there an quick and dirty way to grab this from the order info?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hello Marc,
    Two ways to do this:
    In a custom template, add this snippet:

    
    <?php echo wc_get_order_status_name( $this->order->get_status() ); ?>
    

    or with a template action hook (which you put in your theme functions):

    
    add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_order_status', 10, 2 );
    function wpo_wcpdf_order_status ($template_type, $order) {
        if ($template_type == 'packing-slip') {
            ?>
            <tr class="order-status">
                <th>Order Status:</th>
                <td><?php echo wc_get_order_status_name( $order->get_status() ); ?></td>
            </tr>
            <?php
        }
    }
    

    Hope that helps!
    Ewout

Viewing 1 replies (of 1 total)

The topic ‘Order Status on Packing Slip’ is closed to new replies.