-
Notifications
You must be signed in to change notification settings - Fork 219
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
feat(core): Add currency selector to header #1912
Conversation
🦋 Changeset detectedLatest commit: 8ba35ed The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Skipped Deployments
|
6e87363
to
8d669d2
Compare
8d669d2
to
4761df8
Compare
4761df8
to
c2001f2
Compare
c2001f2
to
4a5c4d2
Compare
4a5c4d2
to
b6b3570
Compare
b6b3570
to
e9f736b
Compare
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.
🍹 Just make sure we have a corresponding PR in VIBES
When it's ready to merge, don't forget a changelog 🙏 |
8f540e6
to
65d9c19
Compare
11e4a96
to
7bf4c24
Compare
7bf4c24
to
4b1fb73
Compare
4b1fb73
to
ef050b0
Compare
3e61ff7
to
66d04bb
Compare
14196de
to
5fe16fc
Compare
5fe16fc
to
8ba35ed
Compare
Co-Authored-By: Chancellor Clark <[email protected]>
8ba35ed
to
707fe92
Compare
syncs with bigcommerce/catalyst#1912
syncs with bigcommerce/catalyst#1912
⚡️🏠 Lighthouse reportLighthouse ran against https://catalyst-canary-1f3eij9x7-bigcommerce-platform.vercel.app 🖥️ DesktopWe ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:
📱 MobileWe ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:
|
* Add currency selector Co-Authored-By: Chancellor Clark <[email protected]> * Abstract cart cookie handling to a common lib * Change currency of cart * Only show transactional currencies in switcher (for now) * Use default currency when there is no preference specified in cookie * Add cart ID + version to key to invalidate cart on currency change --------- Co-authored-by: Chancellor Clark <[email protected]>
* Add currency selector Co-Authored-By: Chancellor Clark <[email protected]> * Abstract cart cookie handling to a common lib * Change currency of cart * Only show transactional currencies in switcher (for now) * Use default currency when there is no preference specified in cookie * Add cart ID + version to key to invalidate cart on currency change --------- Co-authored-by: Chancellor Clark <[email protected]>
* Add currency selector Co-Authored-By: Chancellor Clark <[email protected]> * Abstract cart cookie handling to a common lib * Change currency of cart * Only show transactional currencies in switcher (for now) * Use default currency when there is no preference specified in cookie * Add cart ID + version to key to invalidate cart on currency change --------- Co-authored-by: Chancellor Clark <[email protected]>
What/Why?
currencyCode
httpOnly cookieOnly transactional currencies are supported for now, because we don't have a way to render prices for the cart for a display currency from the API. Theoretically we could use the exchange rate we have access to in the API to calculate the prices within next.js, but my preference would be for all monetary values, even estimates, to come from the API. So for now, I have filtered the list of currencies to only the transactional ones.
Todo
Consider adding a middleware to set this cookie with a query param such as ?setCurrency=USD for the benefit of deep linking and crawlersTesting
Preview deployment:
currency.mov