Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/587 #588

Merged
merged 4 commits into from
Apr 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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