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

Discount code causes issues with checkouts #25

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

MaximilianoRicoTabo
Copy link

  • Hook into pmpro_include_payment_information_fields filter and set global $pmpro_requirebilling to true if child account seats have cost.
image

All Submissions:

Changes proposed in this Pull Request:

Resolves #17

How to test the changes in this Pull Request:

Check steps to reproduce in the issue above

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.

 * Hook into pmpro_include_payment_information_fields filter and set global $pmpro_requirebilling to true if child account seats have cost.
@MaximilianoRicoTabo
Copy link
Author

Also with this fix I think we could remove warning regarding free levels since checkout will work.

image

Thoughts @dparker1005 @kimcoleman ?

@dparker1005
Copy link
Member

#33 contains a similar fix, but does not fix the case where a free discount code is added to checkout via AJAX and CC fields disappear. This is likely an issue that needs to be addressed in core PMPro. Specifically in core, I think maybe we need to use the pmpro_checkout_level filter around here: https://github.com/strangerstudios/paid-memberships-pro/blob/fd6bf1c18315c71013da26d4ab8c0f24e6640591/services/applydiscountcode.php#L80-L87

I am keeping this PR open as a draft as this is a valid workaround for sites that run into this issue going forwards, but this solution will likely not be merged.

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.

Discount code causes issues with checkouts.
2 participants