Title: Status based invoice shown
Last modified: May 17, 2017

---

# Status based invoice shown

 *  Resolved [vickyraje](https://wordpress.org/support/users/vickyraje/)
 * (@vickyraje)
 * [9 years ago](https://wordpress.org/support/topic/status-based-invoice-shown/)
 * Hi,
    How to show pdf & packing slip based on order status if it’s possible. if
   order status on-hold that time hide the buttons when change the order status 
   shown 2 buttons. Other way customer click COD display the button other payment
   hide these button. if it’s possible to do it.
    -  This topic was modified 9 years ago by [vickyraje](https://wordpress.org/support/users/vickyraje/).

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

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [9 years ago](https://wordpress.org/support/topic/status-based-invoice-shown/#post-9144511)
 * Hi! Do by ‘customer’, do you mean the shop manager? Or are you talking about 
   the My Account buttons?
 *  Thread Starter [vickyraje](https://wordpress.org/support/users/vickyraje/)
 * (@vickyraje)
 * [9 years ago](https://wordpress.org/support/topic/status-based-invoice-shown/#post-9144532)
 * Hi,
    shop manager
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [9 years ago](https://wordpress.org/support/topic/status-based-invoice-shown/#post-9144559)
 * Check the code snippet in this post:
    [https://wordpress.org/support/topic/invoice-is-generated-also-with-a-not-confirmend-order/#post-7545411](https://wordpress.org/support/topic/invoice-is-generated-also-with-a-not-confirmend-order/#post-7545411)
 * Adapted to hide the packing-slip as well and updated for WC3.0:
 *     ```
       /**
        * Remove invoice button if order is not completed
        */
       add_filter( 'wpo_wcpdf_listing_actions', 'wpo_wcpdf_restrict_invoice_button', 20, 2 );
       add_filter( 'wpo_wcpdf_meta_box_actions', 'wpo_wcpdf_restrict_invoice_button', 20, 1 );
   
       function wpo_wcpdf_restrict_invoice_button ($actions, $order = '' ) {
           if (empty($order)) {
               global $post_id;
               $order = wc_get_order( $post_id );
           }
           if ($order->get_status() != 'completed') {
               unset($actions['invoice']);
               unset($actions['packing-slip']);
           }
           return $actions;
       }
       ```
   
 * Let me know if you have any other questions!
 * Ewout
 *  Thread Starter [vickyraje](https://wordpress.org/support/users/vickyraje/)
 * (@vickyraje)
 * [9 years ago](https://wordpress.org/support/topic/status-based-invoice-shown/#post-9144674)
 * Hi,
    thankyou it’s working nice. i have another doubt if choose bacs payment 
   gateway order id doesn’t create it’s possible to do it.

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

The topic ‘Status based invoice shown’ 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

 * [Hide buttons](https://wordpress.org/support/topic-tag/hide-buttons/)

 * 4 replies
 * 2 participants
 * Last reply from: [vickyraje](https://wordpress.org/support/users/vickyraje/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/status-based-invoice-shown/#post-9144674)
 * Status: resolved