Posted: January 17, 2023 at 9:59 am
|
I’m using the shortcode [DISPLAY_PDF_BUTTON]. It seems that the class “print_button_div noPrint” does not prevent the button from being shown in the generated invoice PDF file. |
Hi there, Where are you adding the above shortcode? I’ll see if I can reproduce this. |
|
|
in the WP dashboard > event espresso > messages > default message templates > invoice (Edit Purchaser) > main content |
|
I would like to add to the problem the generated and downloaded PDF invoice does not have the same font as the webpage. It seems that CSS is ignored. |
That’s where the default button is added: https://monosnap.com/file/F1XojqBS8pH2nFRbx2DJFR7vbNxMdu In text mode: https://monosnap.com/file/moFZvcT6j0AMcgGk4Ibx7EbgpDnzyO Are you using the same setup?
That usually happens when allow_url_fopen has been disabled on the server. Your host will often have options within your control panel to enable Note – that is likely related to the above as the CSS wont be loading into DOMPDF to hide the button. |
|
|
Okay could there be another solution? I just verified with phpinfo() that allow_url_fopen is enabled for Local value and Master value. |
Can you send me a link to the invoice so I can take a look? You can mark your reply private so only staff can view it. |
|
|
This reply has been marked as private. |
The output your getting is what happens when allow_url_fopen is disabled (yes I know you’ve said it’s enabled above). If you enable WP_DEBUG on the site do you see any error when you load the Invoice page or PDF? Or, you can enable logging using this snippet in your wp-config.php file: https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug Then download the PDF and see if any errors are logged. |
|
|
This reply has been marked as private. |
I’ve seen PHPInfo show allow_url_fopen to be enabled but then it’s not, or specific transport protocols have been disabled so it’s enabled but then doesn’t actually allow the request. Also, if you go to Event Espresso -> Maintenance -> System information, you’ll get a PHPinfo output from within the WordPress environment (because yes, it can be different). Then try enabling WP_DEBUG so that display_errors is enabled and retry. You’re looking for warnings, notices or anything on loading the HTML and PDF requests for the above link. |
|
|
Okay but even in WP it shows as enabled. I have asked our network admin to look in to this. Meanwhile I have added
But there are no errors and so a log is not created. |
So your site throws no notices, warnings, or anything at all? Usually, there is at least 1 notice, warning or something. You’re on PHP8 and WordPress itself throws deprecated notices on the requests with PHP8, so something isn’t adding up here. |
|
|
Our websites won’t be public until the frontend console shows us zero errors. In the backend when using block editor, I do see some typeerrors from event espresso but these are not related to this problem. After using the registration form I have found one Deprecated notice in the logs this morning, but to me it does not look related to the PDF/CSS problem: PHP Deprecated: Required parameter $compare_to follows optional parameter $validation_error_message in ***/wp-content/plugins/event-espresso-core-reg/core/libraries/form_sections/strategies/validation/EE_Equal_To_Validation_Strategy.strategy.php on line 24 To be sure it is not a PHP8 problem I have asked the hosting provider to downgrade to PHP7.4 |
Sure, but front-end/console errors aren’t what I’m referring to. The issue with your PDF’s isn’t a frontend issue, it something happening within DOMPDF when it generates the PDF from the HTML passed to it and generally issues within DOMPDF will show some form of warning/notice/something in the PHP error logs.
Yep, I’d also say that’s unrelated to this.
Did that change anything with this? |
|
|
We have tried PHP7.4 with the same result. There were no PHP errors. We did find some errors about missing files in the server log but after I made these files available I found that EE switches to the old invoice system. (receipt_body.template.php invoice_body.template.php html_invoice_base_default.css html_invoice_print_default.css html_invoice_main_default.css in various places) So I reverted these changes and for now I have removed the download button. |
Hmm, ok. Let’s take a step back here and see if the default Invoice content works, I suspect it will still show the same issue but lets confirm. Go to Event Espresso -> Messages -> Default Message Templates, find the Invoice message type and click ‘Create Custom’ on that line. That’s going to create a custom template based on your current default and take you to the page to edit that template. On that custom message template, hit the ‘Reset templates’ button. Create a temp test event and in the ‘notifications’ section, click the HTML section and chose the Custom template for invoice. Register onto that event, view the invoice (it should look different than your template) and see if the PDF is broken on that. (Note I’m testing here to see if there is something within your customized template that DOMPDF doesn’t like, its much more finick over HTML than your browser is) |
|
|
Changing the template didn’t help but we found that adding www. to our domain fixed the problem. |
The support post ‘[Download PDF] is being printed on Invoice PDF’ 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.