Doc Merge - Quotes - Bundles - How to "hide" a collection if the group is empty

Hello,

I am facing a basic issue but I don't know how to this within Doc Merge syntax.

The problem is the following : I have a quote, with several bundles. Sometimes, some bundles are "empty" (without any quote line items).

Is there a way to set up a condition like if number_of_products > 0 then display my array ?


{#product_bundles}

{if name.length > 0}

{name}

 HOW CAN I HIDE THE FOLLOWING ARRAY IF THERE IS NO PRODUCT FOR THIS BUNDLE ?

Quantity

{!table_header hide_no_data='true' bind='#products'}

Line Item

Part Number

Unit Price

Discount

Line Item Total

{#products sort='position:asc'}

{@index}. {quantity}

{product_template_name.name}

{mft_part_num}

{discount_price}

{discount_amount}

 {total_amount}{/products}

 

 

{total}

 {/product_bundles}


Many thanks for your help

Fred

  • Hello  , 

    Thanks for this question. 


    The parameter hide_no_data='true' does exactly what you described.

    If the bundle has no data, the bundle name (rendered via the {name} variable) will still be displayed, but the table itself will not be shown since the bundle contains no products.

    Could you please confirm if this is what you’re looking for?

    If not, could you provide more details about your scenario so we can try to offer a working example?


    Thanks

    André