-
Notifications
You must be signed in to change notification settings - Fork 10.8k
When applying and removing coupons, leave address data alone in checkout #60106
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
When applying and removing coupons, leave address data alone in checkout #60106
Conversation
Testing GuidelinesHi @ralucaStan , Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
📝 WalkthroughWalkthroughThis change updates the WooCommerce plugin's checkout logic to ensure that when coupons are applied or removed, only the cart contents are updated, preserving the customer's address data. The dispatch calls in relevant thunks are switched from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Possibly related PRs
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: .coderabbit.yml 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.{php,js,jsx,ts,tsx}📄 CodeRabbit Inference Engine (.cursor/rules/code-quality.mdc)
Files:
**/*.{php,js,ts,jsx,tsx}⚙️ CodeRabbit Configuration File
Files:
🧠 Learnings (3)📓 Common learnings
plugins/woocommerce/changelog/wooplug-5216-block-checkout-old-customer-data-getting-loaded-back-into (7)Learnt from: ralucaStan Learnt from: samueljseay Learnt from: jorgeatorres Learnt from: ralucaStan Learnt from: opr Learnt from: mikejolley Learnt from: samueljseay plugins/woocommerce/client/blocks/assets/js/data/cart/thunks.ts (9)Learnt from: dinhtungdu Learnt from: samueljseay Learnt from: vladolaru Learnt from: samueljseay Learnt from: ralucaStan Learnt from: ralucaStan Learnt from: gigitux Learnt from: samueljseay Learnt from: mreishus ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
🔇 Additional comments (3)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Size Change: +7 B (0%) Total Size: 5.92 MB |
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests ok and changes make sense
Submission Review Guidelines:
Changes proposed in this Pull Request:
Prevents address data (which may be in a stale/edited state on checkout) being overridden from the server when applying coupons. Switches out
dispatch.receiveCart
withdispatch.receiveCartContents
which excludes shipping and billing address.Closes #60096
How to test the changes in this Pull Request:
Testing that has already taken place:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment