strangerstudios / pmpro-group-accounts

Sell memberships to corporate organizations, families, teams, or any group of people where one member pays for a collection of people to access your content individually.
https://www.paidmembershipspro.com/add-ons/group-accounts/
0 stars 5 forks source link

Discount code causes issues with checkouts #25

Open MaximilianoRicoTabo opened 7 months ago

MaximilianoRicoTabo commented 7 months ago
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:

Changelog entry

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

MaximilianoRicoTabo commented 7 months ago

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

image

Thoughts @dparker1005 @kimcoleman ?

dparker1005 commented 6 months ago

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.