-
Notifications
You must be signed in to change notification settings - Fork 269
3.0.3 Support multiple discounts #1019
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
Conversation
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.
Pull Request Overview
This PR adds support for multiple discount codes by updating the addDiscount functions in both the input mapper and checkout resource, along with corresponding tests. Key changes include reformatting conditional blocks for improved readability, modifying the addDiscount function to accept multiple discount codes, and updating the checkout resource to merge existing and new discount codes.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/input-map-resource.js | Reformatted conditionals and updated addDiscount to accept multiple discount codes. |
| src/checkout-resource.js | Refactored addDiscount to merge existing discount codes from different parts of the checkout object and adjusted other method invocations. |
| .changeset/ten-cooks-clap.md | Minor changeset update noting the support for multiple discounts. |
Comments suppressed due to low confidence (1)
src/checkout-resource.js:209
- There is a typo in the variable name 'existtingLineCodes'. Consider renaming it to 'existingLineCodes' for clarity.
const existtingLineCodes = checkout.lineItems.map((lineItem) => {
|
/snapit |
1 similar comment
|
/snapit |
Add support for multiple discounts via addDiscount including tests.
Closes #1015