Plugin Contributor
dwpriv
(@dwpriv)
hey yes this is what I was referring to. Does it only show with a live order ?
also is there the ability to add link to emails rather than attachment ?
Plugin Contributor
dwpriv
(@dwpriv)
hey yes this is what I was referring to. Does it only show with a live order ?
The thank page occurs after and order is made, so yes.
also is there the ability to add link to emails rather than attachment ?
You can do this either by editing the email notification template you want download link in, or using a code snippet. Here’s an example snippet you can try:
//Add document download link to the order notification email
add_action( 'woocommerce_email_before_order_table', function( $order, $sent_to_admin, $plain_text, $email ) {
$pdf_url = admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->get_id() . '&order_key=' . $order->get_order_key() );
echo '<a href="' . $pdf_url. '" class="button button-primary">Click to download the invoice</a>';
}, 11, 4 );
thank you very much I will try the snippet 🙂