Last active
December 17, 2020 17:46
-
-
Save jessLundie/603d9ef96f6c0d8fc01662fdd1acd3ac to your computer and use it in GitHub Desktop.
Expand access to subscription downloads in WooCommerce Subscriptions based on subscription status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function expand_access_subscription_downloads( $is_download_permitted, $subscription ) { | |
if ( $subscription->has_status ( 'cancelled', 'expired' ) ) { | |
return true; | |
} | |
return $is_download_permitted; | |
} | |
add_filter ( 'woocommerce_order_is_download_permitted', 'expand_access_subscription_downloads', 10, 2 ); |
We are interested in using this. Do we just place the php file in the subscriptions subfolder?
We are interested in using this. Do we just place the php file in the subscriptions subfolder?
@wprebel - Sorry for the delayed response! If still relevant, I recommend adding this code to your site using a plugin such as Code Snippets. You can also add it to your child theme's functions.php
file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: This code is compatible with content dripping. If Drip downloadable content was enabled throughout the lifetime of the subscription, customers will only have access to files that were available to them based on the site's content dripping settings and their paid renewal orders.