Add additional tr to cart item

lenafuchs
New Member
8 0 0

Hi!

I'm editing my cart.liquid template and want to add additional rows to the cart items table. 

I just added a <tr> inside the for loop, so every product should have 2 rows instead of own (in the second row, I want to display further options/informations about the product). But the additional row always shows up above the whole cart items table. 

 

my code is set up like this:

 

<tbody data-cart-line-items>
          {%- for item in cart.items -%}
            <tr>
          <div> * Additional Info * </div>
          </tr>
            <tr class="cart__row  data-cart-item data-cart-item-key="{{ item.key }}" data-cart-item-title="{{ item.product.title }}" data-cart-item-index="{{ forloop.index }}" data-cart-item-quantity="{{ item.quantity }}"> * Standard Product table data *
            </tr>
          {%- endfor -%}
        </tbody>
 
But it ends up getting displayed like this:
 
<div> * Addtional Info * </div>
<tbody data-cart-line-items="">
<tr class="cart__row  data-cart-item data-cart-item-key="{{ item.key }}" data-cart-item-title="{{ item.product.title }}" data-cart-item-index="{{ forloop.index }}" data-cart-item-quantity="{{ item.quantity }}"> * Standard Product table data * </tr>
</tbody>
 
Could someone please help me figure out why the additional row doesn't get displayed inside the table body?
 
Thanks!!
Replies 0 (0)