• Resolved diegpl

    (@diegpl)


    Hi, does this plugin works well with “WooCommerce Order Status Manager” from Woocommerce? I would like to have my custom statuses in the pdf for the production people in the factory. Tks! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor kluver

    (@kluver)

    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

    Hi, does this plugin works well with “Custom order status for woocommerce” too?
    In my case,
    I would like to send pdf invoice in custom order status email.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom order status in pdfs?’ is closed to new replies.