Roots + FPDF

So I’m knee deep in developing a site for a local chiropractor business and I realize that I need a great Gift Certificate PDF generating tool. Enter FPDF and http://ignitewoo.com/documentation/woocommerce-gift-certificates-pro/. I tested the plugin on TwentyFourteen and it works great! The issue is that that it keeps throwing an error at me when I use the Roots theme.

FPDF error: Some data has already been output, can't send PDF file (output started at /home/eternalw/public_html/blmc/wp-content/themes/blmc/templates/head.php:2)

So my next step was to take a closer look at the code… I’m now 3 hours in and still scratching my head. My best guess is that it’s something with the template hierarchy and that Roots doesn’t play nice with FPDF.

Has anyone else had this issue? Did anyone solve this issue? Any help at all would be super appreciated! :smiley:

It will be the wrapper causing the issue.

Does the plugin have its own conditional or use a custom post type? If so you can test with/for that and opt-out the wrapper with the roots_wrap_base filter.

Thank for the reply, man! I did just that. I read your article again in more detail about the wrapper and used the filter wrap you suggested. After that I axed everything in the base with the except of <?php include roots_template_path(); ?>

Super helpful! Thanks a ton!

Hi @Foxaii @mzeal13 thanks for this info. You reference an article you read about about the wrapper. I was wondering if you could point me in the right direction as I’m having a similar wrapper issue.

Thanks in advance.
Josh

@gishua This topic is 9 years old and the Sage theme has changed quite a bit — please make a new topic that’s relevant to your issue