Viewing 1 replies (of 1 total)
  • Thread Starter agg2

    (@agg2)

    Turns out I had long ago installed this code in my functions.php file and forgot about it:

    # https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/download-link-on-the-thank-you-page/
    
    add_filter('woocommerce_thankyou_order_received_text', 'wpo_wcpdf_thank_you_link', 10, 2);
    function wpo_wcpdf_thank_you_link( $text, $order ) {
        if ( is_user_logged_in() ) {
            $order_id = method_exists($order, 'get_id') ? $order->get_id() : $order->id;
            $pdf_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order_id . '&my-account'), 'generate_wpo_wcpdf' );
            $text .= '<p><a href="'.esc_attr($pdf_url).'">Download a printable invoice / payment confirmation (PDF format)</a></p>';
        }
        return $text;
    }

    This implies there was no setting to enable/disable a download link from within the plugins GUI interface. Is this still the case? Shouldn’t there be an option to easily enable/disable the download link on the Thank You page from within the plugin’s GUI interface?

    • This reply was modified 5 years, 8 months ago by agg2.
Viewing 1 replies (of 1 total)
  • The topic ‘Disable download invoice link on Thank you page?’ is closed to new replies.