Support

Home Forums Event Espresso Premium dompdf error when downloading invoice

dompdf error when downloading invoice

Posted: May 12, 2016 at 11:33 pm


tschoerie

May 12, 2016 at 11:33 pm

Receive the error below when trying to download an invoice. This appears to have occurred after installing WooCommerce PDF Invoices which also used dompdf:

Fatal error: Cannot redeclare class HTML5_Data in /home/pharmo6/public_html/pharmout_working/wp-content/plugins/event-espresso-core-reg/core/third_party_libs/dompdf/lib/html5lib/Data.php on line 6

Any help would be appreciated.


Tony

  • Support Staff

May 13, 2016 at 4:42 am

Hi there,

Which WooCommerce PDF Invoices plugin do you have installed?


tschoerie

May 15, 2016 at 10:37 pm

Hi,

here are the plugin details:

Plugin Name: WooCommerce PDF Invoices
Plugin URI: https://www.woothemes.com/products/pdf-invoices/
Description: Attach a PDF Invoice to the completed order email and allow invoices to be downloaded from customer’s My Account page.
Version: 3.2.1
Author: Andrew Benbow


Tony

  • Support Staff

May 16, 2016 at 4:16 am

Thank you, I’ll check in with our developers on this.

Could you send a copy over to support[at]eventespresso.com so we can investigate further?


tschoerie

May 19, 2016 at 4:44 pm

Hi, I have sent the requested copy to support[at]eventespresso.com – users are currently unable to download any invoices – could you please advise if there is a solution to the conflict. Obviously need the invoice functionality in woocommerce so any workaround or advice would be appreciated.

Thanks,
Steve


tschoerie

May 19, 2016 at 4:45 pm

If I need to use paid support to fix happy to do that also. Please let me know ASAP.


Tony

  • Support Staff

May 20, 2016 at 4:00 am

Hi there,

The problem is because both Woo PDF Invoices and EE and both trying to declare DOMPDF so it throws an error.

However EE already checks for constants that should be defined when DOMPDF is declared which means Woo must be loading it differently than expected. I’ve requested some feedback from our developers on this but as we already check if it has been defined before attempting to ourselves this may take some tracking down.


Tony

  • Support Staff

May 20, 2016 at 12:55 pm

We spent some time discussing this and it turns out the problem is down to the fact that the Woo PDF Invoice plugin loads DOMPDF on every request rather than only where it actually needs to. This means that when EE attempts to load its version of the library Woo already has.

The versions loading differ which means we can’t just us Woo’s version and unfortunately this is not something we can change with how their extension is set up. The best path forward for this is for the author of Woo PDF Invoices to only load DOMPDF when it actually needs to use it and/or wrap the loading of DOMPDF in their plugin within a hook point. This means we can at least hook and prevent them from loading DOMPDF whilst we do.

As it stands EE and Woo PDF Invoices can not be used together on the same site.


tschoerie

May 23, 2016 at 8:51 pm

Thanks, will follow up with WOO and see what they can recommend.


Tony

  • Support Staff

May 24, 2016 at 6:28 am

You’re more welcome.

Please let us know how this goes.


tschoerie

May 29, 2016 at 10:34 pm

Have tried an alternative plugin with the same results after getting no support from Woo. Can you think of any alternatives or a work around for this problem as I need invoices from both WOO and EE.

https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-professional/


Tony

  • Support Staff

May 31, 2016 at 4:04 am

I downloaded a copy of the free version of the plugin from the above link and had no problems generating EE4 Invoices with that version.

Are you using the paid or free version?

If paid can you send a copy to support[at]eventespresso.com so I can test that please.

The support post ‘dompdf error when downloading invoice’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso