I want to add a customers purchase history to there log in page. When they click on their product it would send them to a custom page. I found a site that has something along the lines of this in there scripts.
I can definitely see how it would be useful to have your customers view their purchase history when they login. However, if you have customer accounts enabled, then your customers will already have access to their purchase history, along with the current order status for any purchases they make, when they login to their account on your online store. More information on this is outlined in our help doc on Customers.
Now, are you able to elaborate on what you mean by "when they click on their product, it would send them to a custom page"? I see that you shared a snippet of code, but if you can share a link or screenshot of what this looks like on a website, that would really help! With a bit more context, I'd love to see if I can offer some guidance.
Looking forward to your response!
Julie | Social Care @ Shopify - Was my reply helpful? Click Like to let me know! - Was your question answered? Mark it as an Accepted Solution - To learn more visit the Shopify Help Center or the Shopify Blog