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

fix: show donation receipt immediately after donation #3705

Closed
2 tasks done
ravinderk opened this issue Sep 21, 2018 · 4 comments
Closed
2 tasks done

fix: show donation receipt immediately after donation #3705

ravinderk opened this issue Sep 21, 2018 · 4 comments
Assignees

Comments

@ravinderk
Copy link
Collaborator

ravinderk commented Sep 21, 2018

Current Behavior

Currently, I will see email access form (if enabled) or login form in place of receipt immediately after donation. Few server cached webpage and even do not allow to pass cookies between pages. Give needs cookies information to setup Database session for a donor.

Host on which we detected the issue:

Solution

Few servers allow cookie which has the name with a specific prefix but currently we do not has a filter to edit Give session related cookie. So to solve this issue we have to create new filters which allow the developer to rename session related cookie.

Update

Since WPEngine does not has a workaround to pass cookie between pages, we have to pass the cookie with ajax param (receipt ajax request) and load donor session with that.

Important links:
https://pantheon.io/docs/cookies/

@ravinderk ravinderk self-assigned this Sep 21, 2018
ravinderk added a commit that referenced this issue Sep 21, 2018
cookie_name class property will automatically set in set_cookie_name function, so no need to set explicitly

ref #3705
@ravinderk
Copy link
Collaborator Author

After 2.2.6 if you want to change session cookie name then you can use give_session_cookie filter:

add_filter( 'give_session_cookie', '__give_change_session_cookie_name', 10, 2 );
function __give_change_session_cookie_name( $cookie_name,$cookie_type ){
     return "__custom_prefix_{$cookie_name}"; 
}

@mehul0810
Copy link
Contributor

mehul0810 commented Sep 27, 2018

@ravinderk While working on issue #3556 I've noticed that when logged in with admin and accessing the donation history and then clicking on any of the donation receipts always trigger the latest donation receipt. I doubt that it is fetching the donation receipt from session instead of the actual donation receipt.

My findings

Commenting line https://github.com/WordImpress/Give/blob/release/2.3.0/includes/shortcodes.php#L291 solves the problem. But, need to check whether it is impacting any other area or not.

@ravinderk
Copy link
Collaborator Author

@mehul0810 This issue has been fixed, testing and close this issue (if fixed)

@mehul0810
Copy link
Contributor

Closing this issue as it is working fine as per the commit above by @ravinderk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants