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

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