Hello @forkmedia
Can you go under WooCommerce > PDF Invoices > General tab > How do you want to view the PDF? and select “Open the PDF on a new browser tab/window“.
Let me know.
Thanks for trying to help but I wrote in my original post above that I already did that.
Hi @forkmedia
Sorry for that.
That’s quite strange. Did you update other plugins recently? Are you able to disable the other plugins and see if the issue persist?
The only other plug-in that updated after yours was
WP-Matomo Integration
aka
wp-piwik.1.0.24
I deactivated WP-Matomo Integration and WooCommerce PDF Invoices is back to working as expected.
I don’t use Matomo anymore and forgot it was still activated and updating.
Thanks!
Hi @forkmedia
Glad you find the culprit! We aren’t sure why that happens, probably they modify the header information somehow that breaks the ‘download’ header.
I first tried going back to an earlier version of WooCommerce PDF Invoices, but that made no difference. I then tried Chrome and WooCommerce PDF Invoices worked normally. Now I was really confused.
Your suggestion about the other plugins was also my next plan and thankfully that solved it.
I just now let the developer of Matomo know about the conflict.
Hi @forkmedia
https://github.com/wpovernight/woocommerce-pdf-invoices-packing-slips/blob/v2.6.1/includes/wcpdf-functions.php#L131-L140 normally sets Content-Description: File Transfer but I believe if another plugin has already sent output, these headers can no longer be sent. Probably is here the problem.
Okay, this is weird.
Today it’s happening again and the Matomo plugin is not activated.
I turned a few other plugins off and that didn’t fix it either.
Since pressing the PDF Invoice button works correctly in Chrome, and a few days ago it worked in Firefox (as well as yesterday after deactivating Matomo), I’m really at a loss. I have not added or updated anything else in Firefox or Woocommerce.
When I click either the PDF invoice or Packing Slip button, the item automatically downloads despite the setting asking WooCommerce PDF Invoice to open the browser.
Yesterday I turned off Matomo, the only plugin that had updated since the last WooCommerce PDF Invoice update, and WooCommerce PDF Invoice worked correctly – I tested it several times to make sure. But not today. This kind of irrational behavior in software makes me CRAZY.
It gets weirder.
Now WooCommerce PDF Invoice is skipping my custom template when Firefox, ignoring the General settings, downloads the invoice.
But this new behavior occurs in Chrome as well.
It’s probably something else on this computer that’s causing this. I’ll have to try the plugin on my laptop and see what happens.
OK, this is starting to make sense.
The browser launch for the PDF invoice works on the laptop using the same version of Firefox.
But the template is still a default – at least its not my custom template.
But when trying to figure this out yesterday I deleted the WooCommerce PDF Invoice plugin, then installed a fresh copy of an older version of the plugin. That didn’t make a difference so I updated the plugin to the latest version again. I may have lost the link to my template during that process.
Sorry for all this but I still can’t figure out what on my desktop machine is causing Firefox to conflict erratically with WooCommerce PDF Invoice. If it was consistently not working that’s one thing, but this “working correctly” and then “not working” is maddening.
Writing it out here helps me think it through. If you (@alexmigf) have any suggestions…
OK, I think I solved it.
Besides our Woocommerce store we also have an Etsy account and the same problem occurs with their system of printing and saving PDFs – Firefox just auto downloads the PDF.
Works normally in Chrome, offering options to Print, Save PDF or both.
I went into Firefox preferences and discovered the PDF setting had somehow been changed to Save File instead of Open in Firefox.
Since I am the only person with access to this computer and didn’t chnage it, I’m at a loss to know how it happened. If other settings had been changed I would suspect a bot on some site messed with Firefox.
Also, I did not add any recent extensions/plugins to Firefox.
In retrospect, I should have checked this right off the bat, but because I had not made any changes to Firefox myself, I was thrown off track. And there are so many WordPress and Woocommerce plugin updates coming in (it seems) almost every week, I was sure the problem was a plugin conflict.