Repository navigation
Carry shopper product customization through add-to-cart #1534
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3e76c0b
fix(commerce): carry shopper customization details through add-to-cart
ajaynes-godaddy cc8b6c6
chore: add changeset for cart customization fields
ajaynes-godaddy 454ab95
fix(commerce-storefront): show selected add-ons in the cart drawer
ajaynes-godaddy b014094
fix(commerce-server): validate cart customization before creating the…
ajaynes-godaddy fcde81e
fix(commerce-server): reject malformed cart item shapes with 400 inst…
ajaynes-godaddy 369d84f
fix(commerce-server): force metafield type to JSON server-side
ajaynes-godaddy a9e6460
fix(commerce-storefront): show addon surcharges and drop blank addon …
ajaynes-godaddy 21697dc
Merge branch 'main' into airobuild-9325/widen-cart-contract
ajaynes-godaddy f4256d4
fix(commerce-server): map order-api BAD_USER_INPUT to 400, not 502
ajaynes-godaddy 8a6552e
docs(commerce-server): document order-api's same-SKU merge limitation
ajaynes-godaddy b52c9b8
fix(commerce-storefront): stop addItem from forwarding the whole call…
ajaynes-godaddy c43a612
fix(commerce-server): add a single parseCartItemInput for both cart r…
ajaynes-godaddy 2d84c4a
fix(commerce-server): scope BAD_USER_INPUT mapping to the add-item ro…
ajaynes-godaddy 6888f28
fix(commerce-server): allowlist details/metafields fields and drop th…
ajaynes-godaddy 3c95afb
fix(commerce): drop metafields from the browser-facing cart shape
ajaynes-godaddy 5d5a10d
fix(commerce-storefront): route the addon surcharge through the messa…
ajaynes-godaddy c8909c7
docs(commerce-storefront): document the details/metafields contract o…
ajaynes-godaddy 760c747
docs(commerce-storefront): clarify productAssetUrl wording, cap the s…
ajaynes-godaddy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@godaddy/gd-commerce-server": patch | ||
| "@godaddy/gd-commerce-storefront": patch | ||
| --- | ||
|
|
||
| Carry optional `details` (`productAssetUrl`, `selectedAddons`) and `metafields` through every add-to-cart call, so a shopper's product customization reaches checkout and the order instead of staying client-side only. Existing calls without these fields behave exactly as before. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
order-api uses
data.details?.productAssetUrl || <catalog media>, so any https URL a shopper sends replaces the catalog image on the merchant's order, emails and fulfillment views. If this is meant for design previews, consider restricting it to a host-configured origin allowlist rather than any https URL.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.
I think an allowlist would make sense here, but worry we might "paint ourselves into a corner" so to speak if the allowlist isn't broad enough for it to work well. What hosts would you propose to explicitly allow?
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.
Agreed, let's not add an allowlist for now. It only makes sense if we can confirm Airo uploads design assets to specific CDNs. If we confirm that later, an optional host-configured origin list (with unset meaning any https URL, as today) would avoid painting ourselves into a corner. The https check is fine for this PR.
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.
Leaving this unresolved so it's easier to find when we return to this question.