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 Josh Quigley
12 Jan 2023, 9:33 pm -
Posted by nova-Institut für politische und ökologische Innovation GmbH
26 Nov 2022, 1:32 pm -
Posted by Mark Preuss
19 Sep 2022, 1:37 pm -
Posted by Ian Alport
5 Sep 2022, 8:59 am -
Posted by David
16 Aug 2022, 11:13 pm
Most Fresh Topics
-
Posted by Charlie
17 May 2019, 12:54 am -
Posted by Josh Quigley
12 Jan 2023, 9:33 pm -
Posted by nova-Institut für politische und ökologische Innovation GmbH
26 Nov 2022, 1:32 pm -
Posted by Mark Preuss
19 Sep 2022, 1:37 pm -
Posted by Ian Alport
5 Sep 2022, 8:59 am
Most Popular Topics
-
Posted by M. Hogendoorn
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 Jeremy
23 Jan 2021, 11:17 am -
Posted by Becky Jorgensen
3 Mar 2018, 4:56 am
@anelliot
10:27 pm