Displaying tax as part of the product price
The Tax Categories pages in WebSphere Commerce Accelerator allow you to select an option to include the tax in the product price. Taxes can be displayed for only one tax jurisdiction. In order to display the tax on your product pages (or any page where you display the price), you must ensure that your store profile is set to match the jurisdiction for which you want to display taxes. For example, if you want to display taxes for Jurisdiction 'Canada' then the store profile must also be set to 'Canada'.
About this task
Displaying taxes as part of the product price involves:
- Store profile settings
- Setting up taxes
- Modifying JSP pages
Procedure
-
Ensure that the store profile for the store that you are using is set to the correct
jurisdiction.
- Open the WebSphere Commerce Accelerator.
- From the Store menu, select Change Profile.
- The Store Profile notebook opens. If you do not see this menu, then your logon ID does not have the appropriate authority to perform this task. Contact your Site Administrator.
- From the left navigation frame, click Contact. Ensure that the address information for the store corresponds to the jurisdiction for which you want to display taxes.
- From the left navigation frame, click Location. Ensure that the address information for the store corresponds to the jurisdiction for which you want to display taxes.
-
Setting up taxes:
- Ensure that you have set up taxes to correspond to the jurisdiction for which you want to display taxes. See setting up taxes.
- Ensure that the Tax Category is set up with the 'Include tax in display price' check box selected.
-
Modifying JSP pages:
Modify the following JSP pages to include the sample code provided.Note: If you substitute totalCategorizedValue for categoryAmount in the pieces of sample code below, the total categorized tax amount will be displayed instead of the tax amount from the first category.
- Navigate to WC_eardir/Stores.war/ConsumerDirect/Snippets/Catalog/CatalogEntryDisplay/
- Open the CachedItemDisplay.jsp in a text editor and add the following sample code:
<%-- Start: sample code for item price with tax --%> <fmt:formatNumber value="${item.applicableContractPrices[i].primaryPrice.value}" var="oldPrice"/> <fmt:formatNumber value="${item.displayTaxes.categoryAmount}" var="taxAmount"/> <c:set var="totalPriceWithTax" value="${oldPrice + taxAmount}"/> <td class="price" id="WC_CachedItemDisplay_TableCell_12a_<c:out value="${i}"/>"> <fmt:formatNumber value="${totalPriceWithTax}" type="currency" currencyCode="${CommandContext.currency}"/></td> <%-- End: sample code for item price with tax --%>
- Navigate to the following directory:
- WC_eardir/Stores.war/ConsumerDirect/Snippets/Catalog/CatalogEntryDisplay/
- Open the CachedProductOnlyDisplay.jsp in a text editor and add the following sample code:
<%-- Start: sample code for item price with tax --%> <fmt:formatNumber value="${product.calculatedContractPrice.primaryPrice.value}" var="oldPrice"/> <fmt:formatNumber value="${product.displayTaxes.categoryAmount}" var="taxAmount"/> <c:set var="totalPriceWithTax" value="${oldPrice + taxAmount}"/> <br/> Price with tax: <span class="price"> <fmt:formatNumber value="${totalPriceWithTax}" type="currency" currencyCode="${CommandContext.currency}"/> </span> <br/> <span class="text"> <c:out value="${product.description.longDescription}" escapeXml="false" /> </span> <br/> <%-- End: sample code for item price with tax --%>