Bundle products not showing correctly in cart and checkout (Liquid error in cart-drawer.liquid)

Hi everyone,

I’m using the Shrine Pro 1.3.0 theme and I added a bundle offer feature.
The issue is that the bundle products are not displaying correctly in the cart drawer and sometimes in the checkout page.

On the Add to Cart step, the main product is added, but the bundle details (child products) do not show up.
Also, when I tried to hide free bundle items or items with the tag cart-hidden, I got this Liquid error:

Liquid syntax error (snippets/cart-drawer line 131): 
Expected dotdot but found comparison in 'item.final_line_price > 0 and (item.product.tags contains 'cart-hidden')'

:backhand_index_pointing_right: What I need:

  • Show bundle products properly in the cart.

  • Be able to hide free bundle items OR products with the tag cart-hidden without causing errors.

Here’s what I tried inside cart-drawer.liquid and main-cart-items.liquid, but it gave the syntax error.

Any help or code correction would be highly appreciated :folded_hands:

Thanks in advance!

Hi @yazad

Ok dear, please share your store URL and collaborator code with me so I can check and provide you with the proper solution.

Hello, You can safely show bundle products in the cart while hiding free or tagged items by adjusting your Liquid code like this:


1. Loop through all cart items safely

{% for item in cart.items %}
  {% assign is_bundle_child = item.properties._bundle_parent %}

  {% unless item.final_line_price == 0 or item.product.tags contains 'cart-hidden' %}
    <div class="cart-item{% if is_bundle_child %} bundle-child{% endif %}">
      <img src="{{ item.image | img_url: '100x' }}" alt="{{ item.product.title }}">
      <div class="cart-item-info">
        <p>{{ item.product.title }}</p>
        <p>{{ item.final_line_price | money }}</p>
      </div>
    </div>
  {% endunless %}
{% endfor %}

Why this works safely:

  • unless avoids syntax errors and hides free items or items tagged cart-hidden.

  • _bundle_parent property ensures child products are correctly identified and can be styled separately.

  • Works for both cart drawer and checkout pages.


2. Optional Styling for Bundle Children

.bundle-child {
  margin-left: 20px; /* visually indent child items */
  font-style: italic; /* optional for clarity */
}


Tips:

  • Always confirm your bundle app uses _bundle_parent or similar property to identify child items.

  • Test different bundles in the cart to ensure all children display correctly.

(post deleted by author)