Title: Disable invoice function
Last modified: August 30, 2016

---

# Disable invoice function

 *  Resolved [elsappy](https://wordpress.org/support/users/elsappy/)
 * (@elsappy)
 * [11 years ago](https://wordpress.org/support/topic/disable-invoice-function/)
 * Hi,
 * I’m trying to disable the invoice function because I’m only interested in the
   packing slip function and I’m already using another invoice plugin. How can I
   do that ?
 * I tried to put the code given in that topic in the functions.php file but it 
   doesn’t seem to work : [https://wordpress.org/support/topic/disable-invoice-and-only-use-packing-slip?replies=4](https://wordpress.org/support/topic/disable-invoice-and-only-use-packing-slip?replies=4)
 * Thanks in advance
 * [https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)

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

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/disable-invoice-function/#post-6219158)
 * Hi Elsappy,
    That code only works for english installs. However, in newer versions
   there’s a much better way of doing this. Add the following to your themes functions.
   php:
 *     ```
       /**
        * Remove invoice button from admin and customer my account
        */
       add_filter( 'wpo_wcpdf_listing_actions', 'wpo_wcpdf_remove_invoice', 20, 1 );
       add_filter( 'wpo_wcpdf_myaccount_actions', 'wpo_wcpdf_remove_invoice', 20, 1 );
       add_filter( 'wpo_wcpdf_meta_box_actions', 'wpo_wcpdf_remove_invoice', 20, 1 );
       add_filter( 'wpo_wcpdf_bulk_actions', 'wpo_wcpdf_remove_invoice', 20, 1 );
   
       function wpo_wcpdf_remove_invoice ($actions) {
       	if ( isset($actions['invoice']) ) {
       		unset( $actions['invoice']);
       	}
       	return $actions;
       }
       ```
   
 * Hope that helps!
 * May I ask which plugin you are using for invoices and why you think it’s better?
 * Thanks!
    Ewout
 *  Thread Starter [elsappy](https://wordpress.org/support/users/elsappy/)
 * (@elsappy)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/disable-invoice-function/#post-6219165)
 * Thanks a lot for your answer.
    Unfortunately the code doesn’t work 🙁 I tried
   to disable some plugins but I didn’t find any conflict. (I’m using a custom-made
   plugin)
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/disable-invoice-function/#post-6219174)
 * That’s very strange, I tested the code on my development installation and it 
   works as expected… Which version are you using? Did you get an error or did it
   just not do anything?
 *  Thread Starter [elsappy](https://wordpress.org/support/users/elsappy/)
 * (@elsappy)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/disable-invoice-function/#post-6219177)
 * My apologies, I don’t know what happened but the code works fine !
    Thanks Ewout
   🙂
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/disable-invoice-function/#post-6219452)
 * For anyone looking to do this for specific order statuses:
 *     ```
       /**
        * Remove invoice button for certain statuses
        */
       add_filter( 'wpo_wcpdf_listing_actions', 'wpo_wcpdf_disable_invoice', 20, 2 );
       add_filter( 'wpo_wcpdf_myaccount_actions', 'wpo_wcpdf_disable_invoice', 20, 2 );
       add_filter( 'wpo_wcpdf_meta_box_actions', 'wpo_wcpdf_disable_invoice', 20, 2 );
       function wpo_wcpdf_disable_invoice ( $actions, $order ) {
           // make sure $order is the actual order object
           $order = wc_get_order( $order );
           $order_status = $order->get_status();
           // set allowed order statuses (slugs, so 'on-hold' instead of 'On Hold')
           $allowed_statuses = array( 'completed','processing' );
   
           // remove button/link status not allowed
           if ( !in_array($order_status, $allowed_statuses) ) {
               unset( $actions['invoice']);
           }
   
           return $actions;
       }
       ```
   
 * If you haven’t edited your theme functions before, read this first: [How to use filters](http://docs.wpovernight.com/general/how-to-use-filters/)
 * Ewout

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

The topic ‘Disable invoice function’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [Ewout](https://wordpress.org/support/users/pomegranate/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/disable-invoice-function/#post-6219452)
 * Status: resolved