-
Notifications
You must be signed in to change notification settings - Fork 340
Nest picklist children under parent line items #2726
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
base: canary
Are you sure you want to change the base?
Nest picklist children under parent line items #2726
Conversation
🦋 Changeset detectedLatest commit: 9a009c4 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 |
|
@BC-AdamWard is attempting to deploy a commit to the BigCommerce Platform Team on Vercel. A member of the Team first needs to authorize it. |
| selectedOptions: item.selectedOptions, | ||
| productEntityId: item.productEntityId, | ||
| variantEntityId: item.variantEntityId, | ||
| children: | ||
| formattedChildren.length > 0 ? formattedChildren : undefined, | ||
| }; | ||
| }); | ||
|
|
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.
Bug: The CartViewed component and getAnalyticsData() send unfiltered lineItems (including picklist child items) to analytics, causing double-counting of products.
Severity: CRITICAL | Confidence: 0.95
🔍 Detailed Analysis
The lineItems array passed to the CartViewed component and used in getAnalyticsData() includes both parent and child items from picklist products. This unfiltered array is then sent to analytics via analytics?.cart.cartViewed(), causing child items to be counted as separate products. This leads to inflated item counts and double-counting of products in analytics events when a cart contains picklist products.
💡 Suggested Fix
Filter child items from the lineItems array before passing it to the CartViewed component and getAnalyticsData(). Utilize the already filtered parentItems list for analytics data.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: core/app/[locale]/(default)/cart/page.tsx#L244-L251
Potential issue: The `lineItems` array passed to the `CartViewed` component and used in
`getAnalyticsData()` includes both parent and child items from picklist products. This
unfiltered array is then sent to analytics via `analytics?.cart.cartViewed()`, causing
child items to be counted as separate products. This leads to inflated item counts and
double-counting of products in analytics events when a cart contains picklist products.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference_id: 2790785
|
Pinging @hunterbecton + @andrewreifman to see if they have any design tweaks here! |
@chanceaclark It looks like we're already including the picklist option under the product names, so is it necessary to show it again? Same thing with the quantity. We already display the quantity on the right so it also feels repetitive and not needed. A few more notes:
|
|
@andrewreifman I do not have access to Figma, pinging you on Slack if you can create an export.
I do not think this is viable, as it is possible to create multiple variations of the same parent product using modifiers, and have different quantities on each. Screenshot is current Catalyst behavior, same base product for all three products added by a modifier but the quantity needs to be unique for each one.
Taking a look at other style changes. |

What/Why?
Nest Picklist items under their parent item to achieve Stencil parity.
Testing
Migration
Minor changes.