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

Using the discount code set on the level object when set #3247

Conversation

dparker1005
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

During asynchronous checkouts, we are currently saving the discount code used at checkout in an order meta field and also on the checkout level object. We have seen issues where those discount codes do not match which may cause discount code uses not to be saved.

To streamline our data storage and avoid duplicate (and potentially conflicting) information, this PR makes the discount code set on the checkout level the source of truth. In a future breaking update, discount code data will only be pulled from the checkout level object when completing checkout.

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
@dparker1005 dparker1005 changed the base branch from dev to v3.4 January 20, 2025 19:07
Copy link
Member

@ideadude ideadude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. Ready to merge.

I thought maybe now is the right time to introduce a PMProDiscountCode class, which could among other things abstract and cache the queries to get the code by id/etc, but we can put that off until later. I don't see any big performance concerns here. Would be nice to include in 4.0 though for cleaner code.

@dparker1005 dparker1005 merged commit 599e3fa into strangerstudios:v3.4 Jan 30, 2025
@dparker1005 dparker1005 deleted the use-checkout-object-discount-code-when-completing branch January 30, 2025 15:38
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.

2 participants