/templates/myaccount/my-downloads.php

  1. <?php 
  2. /** 
  3. * My Downloads 
  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. * @depreacated 2.6.0 
  20. */ 
  21.  
  22. if ( ! defined( 'ABSPATH' ) ) { 
  23. exit; // Exit if accessed directly 
  24.  
  25. if ( $downloads = WC()->customer->get_downloadable_products() ) : ?> 
  26.  
  27. <?php do_action( 'woocommerce_before_available_downloads' ); ?> 
  28.  
  29. <h2><?php echo apply_filters( 'woocommerce_my_account_my_downloads_title', __( 'Available downloads', 'woocommerce' ) ); ?></h2> 
  30.  
  31. <ul class="woocommerce-Downloads digital-downloads"> 
  32. <?php foreach ( $downloads as $download ) : ?> 
  33. <li> 
  34. <?php 
  35. do_action( 'woocommerce_available_download_start', $download ); 
  36.  
  37. if ( is_numeric( $download['downloads_remaining'] ) ) 
  38. 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 ); 
  39.  
  40. echo apply_filters( 'woocommerce_available_download_link', '<a href="' . esc_url( $download['download_url'] ) . '">' . $download['download_name'] . '</a>', $download ); 
  41.  
  42. do_action( 'woocommerce_available_download_end', $download ); 
  43. ?> 
  44. </li> 
  45. <?php endforeach; ?> 
  46. </ul> 
  47.  
  48. <?php do_action( 'woocommerce_after_available_downloads' ); ?> 
  49.  
  50. <?php endif; ?> 
.