Display item in cart differently based on product name or collection?

Topic summary

A user sought to display cart items differently based on product attributes, specifically wanting to style fee-related products (smaller display, no image) separately from regular items.

Solution Found:

  • Implemented conditional logic using {% if item.product.title contains "Fee" %} within the cart’s product loop
  • This allows different markup/styling for items containing “Fee” in the title
  • Items are part of a “Fee” collection

Follow-up Question:
Another user asked about applying similar logic based on vendor name instead of product title.

Technical Guidance Provided:

  • Suggested trying {% if item.product.vendor contains "ABC" %} as a potential solution
  • Noted uncertainty about whether vendor attributes are recognized in the cart context
  • Proposed workaround: Add a special character (like asterisk) to product titles as an identifier if vendor-based filtering doesn’t work
  • Emphasized need to locate the cart’s product loop in the theme code (referenced Dawn theme)

Status: Original issue resolved; vendor-based variation remains untested.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

Is it possible to add logic into the cart to display details differently in the cart based on some attribute of the item (either collection, or product title)? I am using products to add fees and I’d like to display them a little differently, such as not showing image, and making the whole line smaller. Every item will have the word “fee” in the title, and will be part of a Fee collection.

If possible, I’d like to be able to group all the Fee items together in the cart as well, but that is secondary.

This is unmodified Product section of cart of Dawn theme for reference.


  {% include 'cart-shipping-calculator' %}
{% endif %}

Found the solution myself.

Just injected this code within the loop

{% if  item.product.title contains "Fee" %}

Hi Joe,

I need the similar solution but for the specific vendor. Say if vendor = “x” then display product row in different style. Please let me know which specific place I need the inject your code.

I couldnt easily show you exactly where to put it (if you’re new to this you’ll want to reseach your theme to see where the “loop” is in the cart), but once you get to the cart code I THINK a modification of my solution MIGHT work:

{% if item.product.vendor contains “ABC” %}

But it might not work. In my original testing, I settled on item title because some other hidden attributes werent being recognized in the cart - so its possible it will not work. If it doesnt work, a rough workaround could be usining my ‘product.title’ solution and put a special character like an asterick in the product title (so long as you’re ok with that appearing everywhere).