Develop > Controller layer > Application developer > Tax codes > Value Added Tax (VAT)
| Next >
Display VAT information on product display pages
If display the tax breakdown for a single catalog entry, we will need to update the JSP to display the proper amounts.
The VAT calculation already happens on the server side. This example demonstrates what VAT information can be retrieved from the server. You can update the own JSP to display such information as you require.
A typical customization is provided.
Take the Madisons store for example.
To display a product's VAT details you can add the JSP snippet below to /Stores/WebContent/Madisons/Snippets/Catalog/CatalogEntryDisplay/CachedProductOnlyDisplay.jsp. To display VAT for item/package/kit/bundle we will need to update the corresponding JSP in a similar way.
<%-- VAT information --%> <table cellpadding="0" cellspacing="0" border="1"> <tr> <th>Gross Price</th> <th>Tax Amount</th> <th>Net Price</th> </tr> <tr> <c:set var="contractPrice" value="${product.calculatedContractPrice.amount}" /> <c:set var="taxAmount" value="${product.displayTaxes.categoryAmount}" /> <td><fmt:formatNumber value="${contractPrice}" type="currency" currencySymbol="${currencyFormatterDB.currencySymbol}" maxFractionDigits="${currencyDecimal}"/></td> <td><fmt:formatNumber value="${taxAmount}" type="currency" currencySymbol="S{currencyFormatterDB.currencySymbol}" maxFractionDigits="${currencyDecimal}"/></td> <td><fmt:formatNumber value="${contractPrice - taxAmount}" type="currency" currencySymbol="${currencyFormatterDB.currencySymbol}" maxFractionDigits="${currencyDecimal}"/></td> </tr> </table> Product: ProductDataBean is available in this JSP
Use the above snippet, the following sample page can be displayed:
| Next >