Title: Fatal error when set to &#039;customer processing order&#039;
Last modified: August 21, 2016

---

# Fatal error when set to 'customer processing order'

 *  Resolved [mother.of.code](https://wordpress.org/support/users/imazed/)
 * (@imazed)
 * The Mother of Code
 * [12 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-when-set-to-customer-processing-order/)
 * Hi there!
 * First off, thank you for this plugin. It works perfectly but for one issue. I
   would like to send my invoices as soon as someone places an order, not afterwards.
   Unfortunately, if I have the ‘customer processing order’ setting selected, the
   following error shows up when placing an order:
 * `Fatal error: Cannot redeclare class mPDF in /wp-content/plugins/woocommerce-
   pdf-invoices/mpdf/mpdf.php on line 65`
 * The order goes through though, it does register and an admin email is send, just
   not to the client. Any way to fix this? Thanks!
 * [https://wordpress.org/plugins/woocommerce-pdf-invoices/](https://wordpress.org/plugins/woocommerce-pdf-invoices/)

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

 *  Thread Starter [mother.of.code](https://wordpress.org/support/users/imazed/)
 * (@imazed)
 * The Mother of Code
 * [12 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-when-set-to-customer-processing-order/#post-4610793)
 * Found a fix for this issue: on line 84 you can find `include(BEWPI_PLUGIN_DIR.'/
   mpdf/mpdf.php');`. Replace it with:
 *     ```
       if(!class_exists('MPDF')){
        include(BEWPI_PLUGIN_DIR . '/mpdf/mpdf.php');
        }
       ```
   
 * Works for me now, without any errors. Sends off all emails perfectly!
 *  Plugin Author [Bas Elbers](https://wordpress.org/support/users/baaaaas/)
 * (@baaaaas)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-when-set-to-customer-processing-order/#post-4610798)
 * Great work! I will add this fix to the next update. Thank you very much! 🙂
 *  [stevo018](https://wordpress.org/support/users/stevo018/)
 * (@stevo018)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-set-to-customer-processing-order/#post-4610949)
 * Hi there,
 * I’m unable to find include(BEWPI_PLUGIN_DIR . ‘/mpdf/mpdf.php’);
 * Is there something I’m missing? It should be just before the EXTERNAL (PUBLIC)
   VARIABLES area, correct?
 * Ryan
 *  [Sinkadus](https://wordpress.org/support/users/niwin/)
 * (@niwin)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-set-to-customer-processing-order/#post-4610950)
 * Hi Steve
 * I made the same mistake. The answer is here: [http://wordpress.org/support/topic/attach-to-new-order-email-type?replies=5](http://wordpress.org/support/topic/attach-to-new-order-email-type?replies=5)
 * / NW
 *  [stevo018](https://wordpress.org/support/users/stevo018/)
 * (@stevo018)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-when-set-to-customer-processing-order/#post-4610951)
 * Perfect, Thank you!
 *  [Lisa](https://wordpress.org/support/users/ikbenlisa/)
 * (@ikbenlisa)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-set-to-customer-processing-order/#post-4610968)
 * Thanks, this helped me a lot!

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

The topic ‘Fatal error when set to 'customer processing order'’ is closed to new
replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices/assets/icon-128x128.png?rev=1128583)
 * [Invoices for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices/reviews/)

 * 6 replies
 * 5 participants
 * Last reply from: [Lisa](https://wordpress.org/support/users/ikbenlisa/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-set-to-customer-processing-order/#post-4610968)
 * Status: resolved