-
Notifications
You must be signed in to change notification settings - Fork 35
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
New shipping option list API #1585
Conversation
packages/ui-extensions-react/src/surfaces/checkout/hooks/shipping-option-target.ts
Outdated
Show resolved
Hide resolved
|
||
export interface ShippingOptionListApi { | ||
/** | ||
* The delivery group the extension is attached to. The target will be undefined if the group is not available. |
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.
We didn't mention when the group will not be available.
From change log:
The target will be
undefined
if the group is not available, for example when the buyer hasn’t entered an address on One-page checkout, or when shipping is unavailable for this address.
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.
Last round of 🎩 for Shipping UI extensions LGTM. I can properly access the target in React using the useDeliveryGroupTarget()
hook on extensions running unstable
. Other versions return undefined
.
Docs + examples LGTM and were reviewed as part of @jonathanhamel4 PR 👍
Background
This PR brings over the latest changes relating to split cart rendering of the
shipping-option-list
targets.The
purchase.checkout.shipping-option-list.render-before
andpurchase.checkout.shipping-option-list.render-after
extension targets now include atarget
to represents the delivery group it is rendering for.This is also accessible using the new
useDeliveryGroupTarget()
react hook.Relevant Docs updates:
Solution
Changes brought over from private package using these instructions in vault.
🎩
Package can be tophatted using these instructions.
purchase.checkout.shipping-option-list.render-before
useDeliveryGroupTarget
hook, you should be able to retrieve the associated delivery group.Checklist