• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / Files / templates/history-purchases.php


Lines:

1 to 65 of 65
<?php if( ! empty( $_GET['edd-verify-success'] ) ) : ?>
<p class="edd-account-verified edd_success">
	<?php _e( 'Your account has been successfully verified!', 'easy-digital-downloads' ); ?>
</p>
<?php
endif;

/**
 * This template is used to display the purchase history of the current user.
 */
if ( is_user_logged_in() ):
  $payments = edd_get_users_purchases( get_current_user_id(), 20, true, 'any' );
  if ( $payments ) :
    do_action( 'edd_before_purchase_history', $payments ); ?>
		<table id="edd_user_history" class="edd-table">
			<thead>
				<tr class="edd_purchase_row">
					<?php do_action('edd_purchase_history_header_before'); ?>
					<th class="edd_purchase_id"><?php _e('ID','easy-digital-downloads' ); ?></th>
					<th class="edd_purchase_date"><?php _e('Date','easy-digital-downloads' ); ?></th>
					<th class="edd_purchase_amount"><?php _e('Amount','easy-digital-downloads' ); ?></th>
					<th class="edd_purchase_details"><?php _e('Details','easy-digital-downloads' ); ?></th>
					<?php do_action('edd_purchase_history_header_after'); ?>
				</tr>
			</thead>
			<?php foreach ( $payments as $payment ) : ?>
				<?php $payment = new EDD_Payment( $payment->ID ); ?>
				<tr class="edd_purchase_row">
					<?php do_action( 'edd_purchase_history_row_start', $payment->ID, $payment->payment_meta ); ?>
					<td class="edd_purchase_id">#<?php echo $payment->number ?></td>
					<td class="edd_purchase_date"><?php echo date_i18n( get_option('date_format'), strtotime( $payment->date ) ); ?></td>
					<td class="edd_purchase_amount">
						<span class="edd_purchase_amount"><?php echo edd_currency_filter( edd_format_amount( $payment->total ) ); ?></span>
					</td>
					<td class="edd_purchase_details">
						<?php if( $payment->status != 'publish' ) : ?>
							<span class="edd_purchase_status <?php echo $payment->status; ?>"><?php echo $payment->status_nicename; ?></span>
							<?php if ( $payment->is_recoverable() ) : ?>
								— <a href="<?php echo $payment->get_recovery_url(); ?>"><?php _e( 'Complete Purchase', 'easy-digital-downloads' ); ?></a>
							<?php endif; ?>
						<?php else: ?>
							<a href="<?php echo esc_url( add_query_arg( 'payment_key', $payment->key, edd_get_success_page_uri() ) ); ?>"><?php _e( 'View Details and Downloads', 'easy-digital-downloads' ); ?></a>
						<?php endif; ?>
					</td>
					<?php do_action( 'edd_purchase_history_row_end', $payment->ID, $payment->payment_meta ); ?>
				</tr>
			<?php endforeach; ?>
		</table>
		<?php
      echo edd_pagination( 
        array(
          'type'  => 'purchase_history',
          'total' => ceil( edd_count_purchases_of_customer() / 20 ) // 20 items per page
        )
      );
    ?>
		<?php do_action( 'edd_after_purchase_history', $payments ); ?>
		<?php wp_reset_postdata(); ?>
	<?php else : ?>
		<p class="edd-no-purchases"><?php _e('You have not made any purchases','easy-digital-downloads' ); ?></p>
	<?php endif;
endif;
 

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      1 to 6 of 6
      • edd_count_purchases_of_customer() – Count number of purchases of a customer
      • edd_currency_filter() – Formats the currency display
      • edd_format_amount() – Returns a nicely formatted amount.
      • edd_get_success_page_uri() – Retrieve the Success page URI
      • edd_get_users_purchases() – Get Users Purchases
      • edd_pagination() – Build pagination

      Call hooks

      1 to 6 of 6
      • edd_after_purchase_history – action
      • edd_before_purchase_history – action
      • edd_purchase_history_header_after – action
      • edd_purchase_history_header_before – action
      • edd_purchase_history_row_end – action
      • edd_purchase_history_row_start – action
      File name: templates/history-purchases.php
      Plugin ref: Easy Digital Downloads
      Version: 2.9.20
      Deprecated?: No
      API Letters: H,P,T

      Published: 26th November 2019 | Last updated: 26th November 2019

      Primary Sidebar

      Information

      File name: templates/history-purchases.php
      Plugin ref: Easy Digital Downloads
      Version: 2.9.20
      Deprecated?: No
      API Letters: H,P,T

      templates

      Footer

      Easy Digital Downloads a2z Easy Digital Downloads a2z
      Easy Digital Downloads a2z
      WordPress 5.3
      WordPress a2z
      WordPress core a2z
      Genesis Theme Framework a2z
      Jetpack a2z
      WordPress develop tests
      Easy Digital Downloads a2z
      WooCommerce a2z
      Yoast SEO a2z
      WordPress Blocks

      Site:  edd.wp-a2z.org
      © Copyright Easy Digital Downloads a2z 2014-2019. All rights reserved.


      Website designed and developed by Herb Miller
      Proudly powered by WordPress and oik plugins

      • Home
      • Blog
      • Sitemap
      • Sites