I have a WP site using
WooCommerce. Our products are made up of physical stock, a download and some links to pages on our site.
I had set this up by placing the links to the specific product pages in WooCommerce's 'downloadable files' section which did work fine until now. Something changed and I get a 'file not on server error' when I try to add links to the 'downloadable files' area now.
I am trying to recreate this by adding the links in manually to the
my-downloads.php file (new template in child theme) but I cannot work out the code to check on the qualifying criteria for the links.
In essence what I need to do is identical to what WooCoomerce does to check which (if any) downloads to display on the My Account page.
The only difference is I want to create a simple link to specific pages on my site (which are private to those who have purchased the item).
It must check:
- if the user is logged in
- have they purchased 'item a', 'item b', 'item c', etc. (4 items, 7 SKU's as 1 product has 4 variations)
- was the purchase in the last 365 days
- if they purchased 'item a' and meet other criteria display link(s)
- if they purchased 'item b' and meet other criteria display link(s)
Any help with this would be greatly appreciated, I am not a programmer, just pretty good with using software and can follow instructions well enough to hack around in php files to get stuff done; I get lost with the hooks and filters and what they return/need.