-
Notifications
You must be signed in to change notification settings - Fork 352
fix(core): persist checkbox modifier in PDP #2817
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
Conversation
🦋 Changeset detectedLatest commit: 0a83e9f 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 GitHub.
|
10a13d9 to
d6764ac
Compare
| // Ensure that if page is reached without a full reload, we are still setting the selection properly based on query params. | ||
| const fieldValue = value || params[field.name]; |
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.
Verified this is no longer needed.
chanceaclark
left a comment
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.
Love it when the changesets is more code than the actual changes ❤️
d6764ac to
074da7c
Compare
878b66a to
0a83e9f
Compare
What/Why?
Persist the checkbox product modifier since it can modify pricing and other product data. By persisting this and tracking in the url, this will trigger a product refetch when added or removed. Incidentally, now we manually control what fields are persisted, since
option.isVariantOptiondoesn't apply tocheckbox, additionally multi options modifiers that are not variant options can also modify price and other product data.Testing
Without insurance:

With insurance (insurance is $100 in this example):

Migration
Step 1
Update
product-options-transformer.tsto manually track persisted fields:Fields that persist and can affect product pricing when selected:
Step 2
Remove
isVariantOptionfrom GQL query since we no longer use it:Step 3
Update
product-detail-form.tsxto include separate handing of the checkbox field:Step 4
Update schema in
core/vibes/soul/sections/product-detail/schema.ts: