Skip to content

Commit

Permalink
Merge pull request #588 from WordImpress/issue/587
Browse files Browse the repository at this point in the history
Issue/587
  • Loading branch information
Devin Walker committed Apr 26, 2016
2 parents c3016b6 + d2dabcd commit 628e7ff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions includes/misc-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ function give_get_ip() {
*/
function give_set_purchase_session( $purchase_data = array() ) {
Give()->session->set( 'give_purchase', $purchase_data );
Give()->session->set( 'give_email', $purchase_data['user_email'] );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions includes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function give_donation_history() {

$email_access = give_get_option( 'email_access' );

//Is user logged in? Does an email-access token exist?
if ( is_user_logged_in() || ( $email_access == 'on' && Give()->email_access->token_exists ) ) {
//Is user logged in? Does a session exist? Does an email-access token exist?
if ( is_user_logged_in() || Give()->session->get_session_expiration() || ( $email_access == 'on' && Give()->email_access->token_exists ) ) {
ob_start();
give_get_template_part( 'history', 'donations' );

Expand Down
6 changes: 6 additions & 0 deletions templates/history-donations.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
$donations = give_get_users_purchases( 0, 20, true, 'any' );
}

//Session active?
if(Give()->session->get_session_expiration()){
$email = Give()->session->get('give_email');
$donations = give_get_users_purchases( $email, 20, true, 'any' );
}

if ( $donations ) : ?>
<table id="give_user_history" class="give-table">
<thead>
Expand Down

0 comments on commit 628e7ff

Please sign in to comment.