view/frontend/templates/product/view/installments.phtml
<?php /* @var $block \UOL\PagSeguro\Block\Product\View\ShowInstallments */
if ($block->isEnabled()) {
$_product = $block->getProduct();
$installments = $block->getInstallment($_product->getFinalPrice());
$countInstallment = count($installments);
$halfInstallment = ceil($countInstallment/2);
$totalAmount = str_replace('.', ',', $installments[$countInstallment-1]['totalAmount']);
echo "<p>Ou pague em até {$installments[$countInstallment-1]['text']} (Total a prazo R\${$totalAmount})</p>";
echo "<table class=\"pagseguro-installments-table\"><tbody>";
for($i = 0; $i < $halfInstallment; $i++) {
echo "<tr><td>{$installments[$i]['text']}</td>";
if (isset($installments[$i + $halfInstallment]['text'])) {
echo "<td>{$installments[$i + $halfInstallment]['text']}</td>";
}
echo "</tr>";
}
echo "</tbody></table>";
}
?>