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

Passing the checkout level to hooks during checkout flow instead of caching #3246

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

dparker1005
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

In 3.0, we added caching to pmpro_getLevelAtCheckout() to speed up Add Ons retrieving checkout level information. However, this caching caused issues in edge cases where incorrect level data was retrieved early on page loads.

This PR passes the actual checkout level object to relevant hooks at checkout in lieu of caching the function. This also has the benefit of simplifying Add On code by directly passing checkout levels into functions instead of retrieving them with a function call.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

@dparker1005 dparker1005 added this to the 3.4 milestone Jan 8, 2025
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

Successfully merging this pull request may close these issues.

1 participant