Hey @minamt,
Could you take a look at this piece of documentation?
Enabling Guest Access
Thread Starter
minamt
(@minamt)
Hi Darren,
I already set Document link access type to ‘Full’ from the advanced settings, I didn’t use hooks, I just used a shortcode for document download and it worked fine, but when I add a button to print the document or to email it, I get a message that I’m missing the access key
Hi @minamt,
It is not clear to me where you are using the shortcode.
Could you please tell me in which page exactly are you placing the shortcode and how (e.g. using the default WordPress editor, editing the page template using some code, etc.)?
Thread Starter
minamt
(@minamt)
Hi @yordansoares,
I made a custom thank you page to display my custom fields after order payment, and I used [wcpdf_document_link] shortcode to get the PDF link, then using the link I wrote JS scripts to print and send the document as an email.
For the custom fields I created a custom PDF template by copying files to child theme.
Thanks for providing more details, @minamt:
In such case, instead of using the shortcode you could adapt the code you find here: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/download-link-on-the-thank-you-page/#enabling-guest-access
The same structure would work for your case, you only have to make sure to pass the correct values to the order_ids and order_key within add_query_arg.