my-downloads.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * My Downloads - Deprecated
  4. *
  5. * Shows downloads on the account page.
  6. *
  7. * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/my-downloads.php.
  8. *
  9. * HOWEVER, on occasion WooCommerce will need to update template files and you
  10. * (the theme developer) will need to copy the new files to your theme to
  11. * maintain compatibility. We try to do this as little as possible, but it does
  12. * happen. When this occurs the version of the template file will be bumped and
  13. * the readme will list any important changes.
  14. *
  15. * @see https://docs.woocommerce.com/document/template-structure/
  16. * @author WooThemes
  17. * @package WooCommerce/Templates
  18. * @version 2.0.0
  19. * @deprecated 2.6.0
  20. */
  21. if ( ! defined( 'ABSPATH' ) ) {
  22. exit; // Exit if accessed directly
  23. }
  24. if ( $downloads = WC()->customer->get_downloadable_products() ) : ?>
  25. <?php do_action( 'woocommerce_before_available_downloads' ); ?>
  26. <h2><?php echo apply_filters( 'woocommerce_my_account_my_downloads_title', __( 'Available downloads', 'woocommerce' ) ); ?></h2>
  27. <ul class="woocommerce-Downloads digital-downloads">
  28. <?php foreach ( $downloads as $download ) : ?>
  29. <li>
  30. <?php
  31. do_action( 'woocommerce_available_download_start', $download );
  32. if ( is_numeric( $download['downloads_remaining'] ) ) {
  33. echo apply_filters( 'woocommerce_available_download_count', '<span class="woocommerce-Count count">' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'woocommerce' ), $download['downloads_remaining'] ) . '</span> ', $download );
  34. }
  35. echo apply_filters( 'woocommerce_available_download_link', '<a href="' . esc_url( $download['download_url'] ) . '">' . $download['download_name'] . '</a>', $download );
  36. do_action( 'woocommerce_available_download_end', $download );
  37. ?>
  38. </li>
  39. <?php endforeach; ?>
  40. </ul>
  41. <?php do_action( 'woocommerce_after_available_downloads' ); ?>
  42. <?php endif; ?>