Plugin Contributor
Ewout
(@pomegranate)
I’m not sure I understand the question, but if you create an order, our plugin can generate an invoice for it. Depending on how you are currently sending the email, you can then use woocommerce_email_attachments to add the invoice.
Thanks for ur fast response.
Its not quite what I mean.
My plan is to send a monthly sum with all sold products incl. tax to my vendors. Not on each purchase.
I will gather the information by myself (sum of products, tax) and just want to generate the pdf with your plugin and my information, and then send it together with my custom mail to the user.
So im wondering if there is function like that:
string generate_invoice($userinfo, $storeinfo, $content) par example which gives me a pdf file back
Plugin Contributor
Ewout
(@pomegranate)
unfortunately not, our plugin can only generate an invoice with order data.
You could use the dompdf wrapper that we provide and feed your own HTML, if you like:
$html = ''; // parse your own template etc.
$pdf_settings = array(
'paper_size' => 'A4',
'paper_orientation' => 'portrait',
'font_subsetting' => true,
);
$pdf_maker = wcpdf_get_pdf_maker( $html, $pdf_settings );
$pdf = $pdf_maker->output();
then store that PDF on your server and pass it to woocommerce_email_attachments. Not trivial stuff though. Hope that helps!
Ok thank you, I’ll look what I can achieve 🙂