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 ignored #39

Open
3 tasks done
ipokkel opened this issue Jun 20, 2022 · 3 comments · May be fixed by #77
Open
3 tasks done

Discount code ignored #39

ipokkel opened this issue Jun 20, 2022 · 3 comments · May be fixed by #77

Comments

@ipokkel
Copy link
Member

ipokkel commented Jun 20, 2022

Describe the bug

When a discount code is applied at checkout where the level has payment plans the discount code cost settings is not applied to the level cost, order, and email data. The payment plan selected at checkout overrides the discount code cost settings.

To Reproduce
Steps to reproduce the behavior:

  1. Create a level with at least 1 payment plan.
  2. Create a discount code for this level and apply the discount code on the checkout page.
  3. See that the discount code updated level cost text is displayed but does not rewrites any payment level cost text in the payment plans section.
  4. Complete checkout and submit.
  5. Confirm on confirmation page, checkout notification email, and order created that the selected payment plan costs was applied instead of the discount code.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.
@ipokkel
Copy link
Member Author

ipokkel commented Jun 20, 2022

A possible temporary workaround to consider is to remove payment plans from the checkout page when a discount code is applied.

https://gist.github.com/ipokkel/c42c5a8a092e18556e64bb59976d5b8b

@dwanjuki
Copy link
Contributor

Another customer ran into similar issues. (Mods: 515592)
Here's a workaround for when the discount code is passed in via the URL:

https://gist.github.com/dwanjuki/1b4f095bf486f1424a98fa1971b05484

@kimcoleman
Copy link
Member

We do not want to support a discount code that works on each payment plan.

The code should always override the level price, just as it does without the Payment Plans Add On. We should always use the level ID's discount code pricing as set in the code.

If there is a discount code applied, either via URL or applied on the checkout page directly, we should hide the payment plans section of the checkout page (use JS to set to hidden on "apply code" or when page renders, hide automatically). The gists here are good starting point for what we will build into this Add On.

MaximilianoRicoTabo added a commit to MaximilianoRicoTabo/pmpro-payment-plans that referenced this issue Nov 27, 2024
 * Bail if discount code is applied via URL.
 * Remove payment plan card if discount code is applied via AJAX.
@MaximilianoRicoTabo MaximilianoRicoTabo linked a pull request Nov 27, 2024 that will close this issue
5 tasks
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 a pull request may close this issue.

3 participants