Thank you @yordansoares for this update .. I just replace the old code in my function file by the new code that you update. and I do this :
Go to WooCommerce?> PDF?Invoices?> Status tab, and set the Document link access type option as Full. In this same screen, enable the Pretty document links option.
but the link not seen in the thank you page as before . can you help me to fix it .
BTW I don’t use any snip it code plugin .. just I add any code manually in config file Sir . thank you for your help in advance .