• Resolved jpilantrose

    (@jpilantrose)


    Hi all,

    I’m trying to get My Account page to show ALL downloads for a product. I have a product with multiple downloads attached to it and right now the My Accounts page only shows the first download for customers that bought the product. When I do an array test of $downloads (see code below) the second download doesn’t even show up! Where do I make woocommerce add the second download to the array.

    Thanks for any help!

    `$downloads = WC()->customer->get_downloadable_products();
    $has_downloads = (bool) $downloads;

    do_action( ‘woocommerce_before_account_downloads’, $has_downloads ); ?>
    <h3>My Downloads</h3>
    <?php if ( $has_downloads ) : ?>

    <?php echo “<script>console.log(‘” . json_encode($downloads) . “‘);</script>”; ?>

    <?php do_action( ‘woocommerce_before_available_downloads’ ); ?>

    <?php do_action( ‘woocommerce_available_downloads’, $downloads ); ?>

    <?php do_action( ‘woocommerce_after_available_downloads’ ); ?>

    <?php else : ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Multiple downloads for a product?’ is closed to new replies.