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

New shipping option list API #1585

Merged
merged 6 commits into from
Dec 6, 2023
Merged

Conversation

jamesvidler
Copy link
Contributor

@jamesvidler jamesvidler commented Dec 5, 2023

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 and purchase.checkout.shipping-option-list.render-after extension targets now include a target 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.

  1. Render an extension using the purchase.checkout.shipping-option-list.render-before
  2. Using the useDeliveryGroupTarget hook, you should be able to retrieve the associated delivery group.
    Screenshot 2023-12-06 at 9 43 01 AM

Checklist

  • This needs to be updated once this docs PR ships.
  • I have 🎩'd these changes
  • I have updated relevant documentation

@jamesvidler jamesvidler changed the title initial cut from private package Updated shipping option list API Dec 5, 2023
@jamesvidler jamesvidler marked this pull request as ready for review December 6, 2023 14:29
@jamesvidler jamesvidler changed the title Updated shipping option list API New shipping option list API Dec 6, 2023
.changeset/six-pandas-fix.md Outdated Show resolved Hide resolved
.changeset/six-pandas-fix.md 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.
Copy link
Contributor

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.

Copy link
Contributor

@loic-d loic-d left a 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 👍

@jamesvidler jamesvidler merged commit 7b4127f into unstable Dec 6, 2023
5 checks passed
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.

None yet

4 participants