• Resolved greg241414

    (@greg241414)


    Hey guys,

    Invoice generates fine and attaches to email ok but we want to add a link to thank you page.

    We have tried the shortcode and nothing appears if we preview thank you page and also we have tried snippet and the same thing… nothing

    Will it only display a link on a live order or?

    Kind Regards,
    Greg

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor dwpriv

    (@dwpriv)

    Thread Starter greg241414

    (@greg241414)

    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 );
    Thread Starter greg241414

    (@greg241414)

    thank you very much I will try the snippet 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Thank you Page Shortcode’ is closed to new replies.