Bez popisu

downloads.php 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Downloads
  4. *
  5. * Shows downloads on the account page.
  6. *
  7. * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/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. * @package WooCommerce\Templates
  17. * @version 3.2.0
  18. */
  19. if ( ! defined( 'ABSPATH' ) ) {
  20. exit;
  21. }
  22. $downloads = WC()->customer->get_downloadable_products();
  23. $has_downloads = (bool) $downloads;
  24. do_action( 'woocommerce_before_account_downloads', $has_downloads ); ?>
  25. <?php if ( $has_downloads ) : ?>
  26. <?php do_action( 'woocommerce_before_available_downloads' ); ?>
  27. <?php do_action( 'woocommerce_available_downloads', $downloads ); ?>
  28. <?php do_action( 'woocommerce_after_available_downloads' ); ?>
  29. <?php else : ?>
  30. <div class="woocommerce-Message woocommerce-Message--info woocommerce-info">
  31. <a class="woocommerce-Button button" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ) ); ?>">
  32. <?php esc_html_e( 'Browse products', 'woocommerce' ); ?>
  33. </a>
  34. <?php esc_html_e( 'No downloads available yet.', 'woocommerce' ); ?>
  35. </div>
  36. <?php endif; ?>
  37. <?php do_action( 'woocommerce_after_account_downloads', $has_downloads ); ?>