Created
August 4, 2021 10:46
-
-
Save kreamweb/99a74d7196279917086720a310e452df to your computer and use it in GitHub Desktop.
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 | |
if ( function_exists( 'YITH_WC_Subscription_Frontend' ) ) { | |
add_filter( 'woocommerce_customer_get_downloadable_products', 'woocommerce_order_get_downloadable_items_ywsbs_helper' ); | |
function woocommerce_order_get_downloadable_items_ywsbs_helper( $downloads ) { | |
if ( ! is_account_page() ) { | |
return $downloads; | |
} | |
$used = array(); | |
$singles = array(); | |
foreach ( $downloads AS $key => $line ) { | |
if ( !in_array($line['download_id'], $used) ) { | |
$used[] = $line['download_id']; | |
$singles[] = $line; | |
} | |
} | |
return $singles; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment