My use case requires that once customers have downloaded a free product, they should always be able to access that product in the My Downloads section of their account. However, the products are only free for a month (using a scheduled sale); then they revert back to a paid price. It seems that the default behavior with this plugin is to remove the download in My Downloads when the price has been changed and is no longer free. Is there a setting that allows previously downloaded products to persist in My Downloads, even if the product itself is no longer free? Apologies if there is and I've missed it; I just haven't found a way to do this.
Home > Community > Forums > Free Downloads WooCommerce Pro
Products disappearing from My Downloads on price change
Posted by: Amber Elliot
5th May 2021, 10:27 pm
-
Hi Amber, before getting into it I should advise that download history logs are stored in the DB and if those logs were ever cleared out, the user's download history, and subsequently showing it on their account page, would also disappear.
The simplest way to achieve what you want would also have the side effect of allowing those users to download the files from the product page again. Is that going to be an issue?
-
Thanks so much for your response. The download logs makes perfect sense, and I don't plan to clear those out.
It's completely fine if the users who have already downloaded the products to be able to download them again from the product page; the users who have already downloaded them once can always have free access to them.
-
Hi Amber, if you use a plugin called Code Snippets you can add the following snippet:
add_filter('somdn_is_product_valid', 'custom_somdn_product_valid_if_downloaded', 99, 2); function custom_somdn_product_valid_if_downloaded($valid, $product_id) { $downloaded = somdn_has_user_downloaded_product($product_id, get_current_user_id()); if ($downloaded == true) { return true; } return $valid; }
Let me know how you get on.
-
This worked perfectly! Thank you so much for your help, I really appreciate it.
-
No problem 🙂
This topic is closed to new replies.
Latest Topics
-
Posted by H.M.
19 Nov 2024, 7:15 pm -
Posted by H.M.
5 Nov 2024, 11:25 am -
Posted by Jason Absolom
3 Nov 2024, 11:25 pm -
Posted by Jason Absolom
29 Oct 2024, 9:49 am -
Posted by Jason Absolom
27 Oct 2024, 11:42 pm
Most Fresh Topics
-
Posted by Jason Absolom
3 Nov 2024, 11:25 pm -
Posted by H.M.
19 Nov 2024, 7:15 pm -
Posted by Jason Absolom
23 Oct 2024, 12:08 pm -
Posted by H.M.
5 Nov 2024, 11:25 am -
Posted by Jason Absolom
29 Oct 2024, 9:49 am
Most Popular Topics
-
Posted by H.M.
7 Oct 2021, 11:11 am -
Posted by newoceans
2 Jan 2018, 10:19 pm -
Posted by Elio Bergamini
23 Nov 2020, 7:32 pm -
Posted by Jason Absolom
23 Oct 2024, 12:08 pm -
Posted by Jeremy
23 Jan 2021, 11:17 am
@anelliot
10:27 pm