I have a custom PDF in PDFManager.
I need to loop inside a table:
<table header>
<loop through the rows>
<table footer>
This works fine but....
<!--START_PRODUCT_LOOP-->
<tr>
<td>{foreach from=$bundle.products item="product"}</td>
</tr>
<tr>
<td>{if isset($product.quantity)}{$product.quantity}{/if}</td>
<td>{if isset($product.name)}{$product.name}{/if}</td>
<td class="right">{if $fields.display_discount_c}{if isset($product.discount_price)}{$product.discount_price}{/if}{/if}</td>
<td class="right">{if $fields.display_discount_c}{if isset($product.ext_price)}{$product.ext_price}{/if}{else}{if $product.total_amount}{$product.total_amount}{/if}{/if}</td>
<td class="right">{sugar_currency_format var=$product.line_tax_amount_c currency_id=$product.currency_id}</td>
<td class="right">{if $fields.display_discount_c}{if isset($product.discount_amount)} {if !empty($product.discount_select)} {sugar_number_format var=$product.discount_amount}% {else} {sugar_currency_format var=$product.discount_amount currency_id=$product.currency_id} {/if}{/if}{/if}</td>
</tr>
<tr>
<td>{/foreach}</td>
</tr>
<!--END_PRODUCT_LOOP-->
it adds two blank lines between products (one for the open foreach and one of the end);
I have to add a row to the table to house the smarty for the foreach, otherwise, it gets automatically moved to outside the table (as any text would if placed outside row tags on an html table).
What is the correct way to do this without introducing blank lines?
Thanks
FrancescaS
Hi
i have almost the same problem and cant find solution.
This is my code
<table border="1">
<tbody>
{if $revenuelinesitems.intk_setrefrecob_chk_c =="1"}
<tr>
<td>{"Recommended Spare Parts B "}</td>
<td>{$revenuelinesitems.intk_preciocostom50mb17_cur_c}</td>
</tr>
{/if}
{if $revenuelinesitems.intk_motprinie2nbr_chk_c =="1"}
<tr>
<td>{"Main Motor - IE2(NBR Rating (Brasil) "}</td>
<td>{$revenuelinesitems.intk_preciocostom50mb32_cur_c}</td>
</tr>
{/if}
</tbody>
</table>
But not working.
Sugar put out my code of the html table.
some ideas?
thnks