evolve_woocommerce_before_account_downloads

The evolve evolve woocommerce before account downloads function.

Description

evolve_woocommerce_before_account_downloads( $args ); 

Parameters (1)

0. $args
The args.

Usage

  1. if ( !function_exists( 'evolve_woocommerce_before_account_downloads' ) ) { 
  2. require_once '/library/woo-config.php'; 
  3.  
  4. // The args. 
  5. $args = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = evolve_woocommerce_before_account_downloads($args); 
  9.  

Defined (1)

The function is defined in the following location(s).

/library/woo-config.php  
  1. function evolve_woocommerce_before_account_downloads($args) { 
  2. if ($downloads = WC()->customer->get_downloadable_products()) : 
  3.  
  4. ?> 
  5.  
  6. <h2><?php echo apply_filters('woocommerce_my_account_my_downloads_title', __('Available Downloads', 'evolve')); ?></h2> 
  7.  
  8. <ul class="woocommerce-Downloads digital-downloads"> 
  9. <?php foreach ($downloads as $download) : ?> 
  10. <li> 
  11. <?php 
  12. do_action('woocommerce_available_download_start', $download); 
  13.  
  14. if (is_numeric($download['downloads_remaining'])) { 
  15. $downloads_remaining = $download['downloads_remaining']; 
  16. echo apply_filters('woocommerce_available_download_count', '<span class="woocommerce-Count count">' . sprintf( _n( '%s download remaining', '%s downloads remaining', $downloads_remaining, 'evolve' ), $download['downloads_remaining'] ) . '</span> ', $download); 
  17.  
  18. echo apply_filters('woocommerce_available_download_link', '<a href="' . esc_url($download['download_url']) . '">' . $download['download_name'] . '</a>', $download); 
  19.  
  20. do_action('woocommerce_available_download_end', $download); 
  21. ?> 
  22. </li> 
  23. <?php endforeach; ?> 
  24. </ul> 
  25.  
  26. <?php 
  27. else : 
  28. ?> 
  29. <div class="woocommerce-Message woocommerce-Message--info woocommerce-info digital-downloads"> 
  30. <a class="woocommerce-Button button" href="<?php echo esc_url(apply_filters('woocommerce_return_to_shop_redirect', wc_get_page_permalink('shop'))); ?>"> 
  31. <?php esc_html_e('Go Shop', 'evolve') ?> 
  32. </a> 
  33. <?php esc_html_e('No downloads available yet.', 'evolve'); ?> 
  34. </div> 
  35. <?php 
  36. endif;