Added an online store order status route #540
Merged
Merged
Conversation
Contributor
|
@benjaminsehl this is a good candidate for auto generation via |
blittle
reviewed
Feb 22, 2023
| cache: storefront.CacheLong(), | ||
| }); | ||
| invariant(shop, 'Error redirecting to the order status URL'); | ||
| return redirect(request.url.replace(origin, shop.primaryDomain.url)); |
Contributor
There was a problem hiding this comment.
There's a script we recommend merchants adopt in the online store to redirect users to the custom storefront. If that script isn't implemented correctly, this could create an infinite redirect. Maybe there's a way we could check the request referer to prevent a redirect?
Contributor
Author
There was a problem hiding this comment.
Brett, are you talking about a client side redirect in theme.liquid? If so, I don't believe the Shopify order status route uses theme.liquid for it's rendering.
blittle
reviewed
Feb 22, 2023
Contributor
blittle
left a comment
There was a problem hiding this comment.
This is great, @benjaminsehl this is one of those kinda built in routes that we might want to make easier.
blittle
approved these changes
Mar 13, 2023
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added a route to demonstrate redirecting an order status url back to the online store primary domain. If merchants had been live on the online store before launching a Hydrogen storefront, previous order status urls emailed to customers are likely using the root/apex domain that post launch in all likelihood is now resolving to the Hydrogen storefront.
I added an ErrorBoundary export in the event the shop object is null so that the user would be able to try again or would be able to navigate to another area of the storefront.
The final version of this order status redirect should be included in our Oxygen help here which currently only has the v1 version of handling this redirect.