I am trying to add a download link on the thank you page on Shopify. I successfully added it following this guide:
But, when someone views an order status page directly (try copying and pasting the URL to a new incognito window), shopify would request for an email and order number before it displays the complete information on a page.
Log in to view all shipment details
You can find your order number in the receipt you received via email.
The problem is that the download link that I added are not hidden! Is there a workaround for this? To show the link only if the email and order number is provided.
I get your point and I think this actually might be something Shopify has overseen or something that is undocumented.
I've tried numerious ways to see if there is a hidden feature you could utilize but into no prevail. Only thing I can think about is checking for cookie existance but that is something that is far from ideal as the link would still exists inside the code and be clientsided.
What has always puzzled me with the Thank You page is the way that even "customer" object returns true even if you arent logged in.
The thank you page is quite secure anyway to be honest as the url handle is random.
But then again there is a small possibility of someone sniffing it and seeing the download link, it would make sense to add something to make you be able to check if the user is actually logged in or if the content of the page is hidden (address etc).
Please see attached file. I can't share a link since my site is still under development. What I'm looking for is something to hide the additional code in the checkout section.
Something like 'if not validated, hide section', just like the shipping and billing info at the bottom.
Unfortunately I was unable to find a solution myself, I'm guessing this might be an oversight on shopifys side.
The only way you could do it is with a bit of JS that would hide the text if the form exists, less than ideal as the link would still be in the source code.
I just want to post a workaround for this problem...
You can use the property "first_time_accessed" to display the link immediately after purchase..