Geen omschrijving

order-downloads.php 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * Order Downloads.
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/order/order-downloads.php.
  6. *
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you
  8. * (the theme developer) will need to copy the new files to your theme to
  9. * maintain compatibility. We try to do this as little as possible, but it does
  10. * happen. When this occurs the version of the template file will be bumped and
  11. * the readme will list any important changes.
  12. *
  13. * @see https://docs.woocommerce.com/document/template-structure/
  14. * @package WooCommerce\Templates
  15. * @version 3.3.0
  16. */
  17. if ( ! defined( 'ABSPATH' ) ) {
  18. exit;
  19. }
  20. ?>
  21. <section class="woocommerce-order-downloads">
  22. <?php if ( isset( $show_title ) ) : ?>
  23. <h2 class="woocommerce-order-downloads__title"><?php esc_html_e( 'Downloads', 'woocommerce' ); ?></h2>
  24. <?php endif; ?>
  25. <table class="woocommerce-table woocommerce-table--order-downloads shop_table shop_table_responsive order_details">
  26. <thead>
  27. <tr>
  28. <?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
  29. <th class="<?php echo esc_attr( $column_id ); ?>"><span class="nobr"><?php echo esc_html( $column_name ); ?></span></th>
  30. <?php endforeach; ?>
  31. </tr>
  32. </thead>
  33. <?php foreach ( $downloads as $download ) : ?>
  34. <tr>
  35. <?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
  36. <td class="<?php echo esc_attr( $column_id ); ?>" data-title="<?php echo esc_attr( $column_name ); ?>">
  37. <?php
  38. if ( has_action( 'woocommerce_account_downloads_column_' . $column_id ) ) {
  39. do_action( 'woocommerce_account_downloads_column_' . $column_id, $download );
  40. } else {
  41. switch ( $column_id ) {
  42. case 'download-product':
  43. if ( $download['product_url'] ) {
  44. echo '<a href="' . esc_url( $download['product_url'] ) . '">' . esc_html( $download['product_name'] ) . '</a>';
  45. } else {
  46. echo esc_html( $download['product_name'] );
  47. }
  48. break;
  49. case 'download-file':
  50. echo '<a href="' . esc_url( $download['download_url'] ) . '" class="woocommerce-MyAccount-downloads-file button alt">' . esc_html( $download['download_name'] ) . '</a>';
  51. break;
  52. case 'download-remaining':
  53. echo is_numeric( $download['downloads_remaining'] ) ? esc_html( $download['downloads_remaining'] ) : esc_html__( '&infin;', 'woocommerce' );
  54. break;
  55. case 'download-expires':
  56. if ( ! empty( $download['access_expires'] ) ) {
  57. echo '<time datetime="' . esc_attr( date( 'Y-m-d', strtotime( $download['access_expires'] ) ) ) . '" title="' . esc_attr( strtotime( $download['access_expires'] ) ) . '">' . esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) ) . '</time>';
  58. } else {
  59. esc_html_e( 'Never', 'woocommerce' );
  60. }
  61. break;
  62. }
  63. }
  64. ?>
  65. </td>
  66. <?php endforeach; ?>
  67. </tr>
  68. <?php endforeach; ?>
  69. </table>
  70. </section>