Posted: 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. |
|
Hi there, Which WooCommerce PDF Invoices plugin do you have installed? |
|
Hi, here are the plugin details: Plugin Name: WooCommerce PDF Invoices |
|
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? |
|
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, |
|
If I need to use paid support to fix happy to do that also. Please let me know ASAP. |
|
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. |
|
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. |
|
Thanks, will follow up with WOO and see what they can recommend. |
|
You’re more welcome. Please let us know how this goes. |
|
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/ |
|
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.