Skip to content

Conversation

@BC-AdamWard
Copy link
Contributor

@BC-AdamWard BC-AdamWard commented Nov 19, 2025

What/Why?

Nest Picklist items under their parent item to achieve Stencil parity.

Testing

  1. Create a product with a PickList product option (modifier) added.
  2. Navigate to Catalyst storefront
  3. Add product to cart
  4. Validate the picklist item appears nested with the parent item.
image image

Migration

Minor changes.

@BC-AdamWard BC-AdamWard requested a review from a team as a code owner November 19, 2025 02:55
@changeset-bot
Copy link

changeset-bot bot commented Nov 19, 2025

🦋 Changeset detected

Latest commit: 9a009c4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Minor

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

@vercel
Copy link

vercel bot commented Nov 19, 2025

@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.

Comment on lines 244 to 251
selectedOptions: item.selectedOptions,
productEntityId: item.productEntityId,
variantEntityId: item.variantEntityId,
children:
formattedChildren.length > 0 ? formattedChildren : undefined,
};
});

Copy link

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

@chanceaclark
Copy link
Contributor

Pinging @hunterbecton + @andrewreifman to see if they have any design tweaks here!

@andrewreifman
Copy link
Contributor

andrewreifman commented Nov 19, 2025

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:

  • Instead of displaying the picklist label (Another product in this scenario), could we just display the value selected? And if there are more than one variant to show, can we just separate them by commas (see Figma mockups)
  • For the variant info, we should probably increase the contrast. It looks pretty light and hard to read at the moment.

@BC-AdamWard
Copy link
Contributor Author

@andrewreifman I do not have access to Figma, pinging you on Slack if you can create an export.

Instead of displaying the picklist label (Another product in this scenario), could we just display the value selected? And if there are more than one variant to show, can we just separate them by commas

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.

image

Taking a look at other style changes.

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.

3 participants