Skip to content
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

Show bundle components on the cart page #3478

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mironov
Copy link

@mironov mironov commented May 15, 2024

PR Summary:

Show bundle components on the cart page

Why are these changes introduced?

Fixes #3477

What approach did you take?

Render item.item_components if they are present.

Other considerations

n/a

Decision log

n/a

Visual impact on existing themes

Enhance user experience for bundles.

Testing steps/scenarios

  • Add a regular product to cart and confirm no components are rendered
  • Add a bundled product to cart and confirm that its components are rendered

Demo links

Chromium.mp4

Checklist

@NicklasT
Copy link

It seems like bundle components are still not shown on the cart page. Why has this not made it into Dawn yet?

Copy link
Contributor

@ludoboludo ludoboludo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the HTML tag used looks good.
Thanks for the PR 👍

Comment on lines 130 to 135
<sub>
{{ component.title }}
{%- if component.quantity > 1 -%}
<span> × {{ component.quantity }}</span>
{%- endif -%}
</sub>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is the right element for the job. Id go with an unordered list instead maybe.

When i look at the sub element in docs, MDN for example, it does mention using them in specific scenarios:

should be displayed as subscript for solely typographical reasons

Copy link

@thagxt thagxt Jan 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice others have conditionals for default variants, size, and selling plans, but there's no explicit check for whether the item is a bundle. Did we intend to add a condition for that, or is it not necessary in this particular context?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also if added to cart isn't this needed on orders page as well?!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ludoboludo I've switched it to an unordered list — does it look better now?

image

It might need a bit of CSS tweaking, especially for the left margin.

Copy link
Contributor

@ludoboludo ludoboludo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just one more little tweak.

sections/main-cart-items.liquid Outdated Show resolved Hide resolved
Copy link
Contributor

@lhoffbeck lhoffbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Today for a product with variants, the cart renders the selected variant's product options:

Screenshot 2025-02-04 at 8 22 19 AM

Because of this, rendering out the line components would result in some duplicated info:

Screenshot 2025-02-04 at 8 21 13 AM

I'm chatting with the bundles team internally to see what they want to do here.

@carrotderek
Copy link

Hi @mironov, thanks for creating this PR 🙏🏼!

At this moment, we're considering how to best represent and handle components within the theme. Since the area is under evaluation and may undergo changes, we believe it's prudent to hold off on merging new changes related to this functionality.

Again, thanks for your contribution. We really appreciate the time and effort invested and encourage you to stay involved once we've solidified our plans.

@mironov
Copy link
Author

mironov commented Feb 6, 2025

@carrotderek That's great to hear! I'm really excited that the team is actively exploring ways to improve how bundles are displayed in the Dawn theme.

We found that bundles created with cart transform functions often run into minor quirks in the native Shopify themes, particularly with how they're displayed on collection pages or in the cart. I'd love to share some of our findings if that might help inform future improvements. Let me know if there's any way I can assist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Render bundle components on cart page
6 participants