My current quote line items table has this code:
<div class=“line-items__table-scrollable”>
<table class=“{{ table_class|escape_attr }}”>
<thead class=“line-items__table-header–main”>
<tr>
{% for title in module.line_item_column %}
<th scope=“col”>{{ title.column_title|sanitize_html }}</th>
{% endfor %}
</tr>
</thead>
<tbody id=“line-items__table-body”>
{% set has_present_line_items = LINE_ITEMS|length > 0 %}
{% set has_future_line_items = FUTURE_PAYMENTS|length > 0 %}
{% set has_both_line_items = has_present_line_items and has_future_line_items %}
{% if has_present_line_items %}
{{ line_items_table_rows(LINE_ITEMS, has_both_line_items ? module.line_item_subheadings.due_now_text : null) }}
{% endif %}
{% if has_future_line_items %}
{{ line_items_table_rows(FUTURE_PAYMENTS, has_both_line_items ? module.line_item_subheadings.due_later_text : null, true) }}
{% endif %}
</tbody>
</table>
</div>
{% endif %}
It looks like this:
I’m trying to figure out the code to make it where if there is nothing in the cells for the “prepaid frieght minimum” columns, for it to not display the column at all.
Is this possible?
This is the code I keep messing around with trying to get it to work:
{% set show_n12_cs_144_tubes_column = false %}
{# Step 1: Check if any unit has a non-empty ‘n12_cs___144_tubes’ property #}
{% for unit in line_items %}
{% if unit.n12_cs___144_tubes %}
{% set show_n12_cs_144_tubes_column = true %}
{% break %}
{% endif %}
{% endfor %}
{# Step 2: Conditionally render the column if ‘show_n12_cs_144_tubes_column’ is true #}
{% if show_n12_cs_144_tubes_column %}
<th class=“your-column-header-class”>12 CS / 144 Tubes</th>
{% for unit in line_items %}
<td class=“{{ cell_print_max_width_class|escape_attr }}”>
{% if unit.n12_cs___144_tubes %}
<strong>${{ unit.n12_cs___144_tubes|sanitize_html }}</strong>\ /\ unit
{% endif %}
</td>
{% endfor %}
{% endif %}
I’ve tried a number of different possibilities and I keep getting Error: Cannot resolve property. I have tried a number of different ways of typing the parts that are bolded in the above code too.
And I’ve tried doing the display conditions in the right panel of the design manager as well:
Any way to get this to work or another way to try it?
Thanks!




