Develop > Controller layer > Application developer > Tax codes


Display 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 the product pages (or any page where you display the price), ensure that the store profile is set to match the jurisdiction for which to display taxes. For example, to display taxes for Jurisdiction 'Canada' then the store profile must also be set to 'Canada'.

Display taxes as part of the product price involves:


Procedure

  1. Verify the store profile for the store that you are using is set to the correct jurisdiction.

    1. Open the WebSphere Commerce Accelerator.

    2. From the Store menu, select Change Profile.

    3. The Store Profile notebook opens. If you do not see this menu, then the logon ID does not have the appropriate authority to perform this task. Contact the Site Administrator.

    4. From the left navigation frame, click Contact. Verify the address information for the store corresponds to the jurisdiction for which to display taxes.

    5. From the left navigation frame, click Location. Verify the address information for the store corresponds to the jurisdiction for which to display taxes.

  2. Set up taxes:

    1. Ensure that you have set up taxes to correspond to the jurisdiction for which to display taxes. See setting up taxes.

    2. Verify the Tax Category is set up with the 'Include tax in display price' check box selected.

  3. Modify JSP pages: Modify the following JSP pages to include the sample code provided.

    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.

    1. Navigate to WC_EAR/Stores.war/ConsumerDirect/Snippets/Catalog/CatalogEntryDisplay/

    2. 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 --%>
      

    3. Navigate to the following directory:

      • WC_EAR/Stores.war/ConsumerDirect/Snippets/Catalog/CatalogEntryDisplay/

      • WC_EAR/Stores.war/ConsumerDirect/Snippets/Catalog/CatalogEntryDisplay/

    4. 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 --%>
      


Related tasks

Define tax categories


+

Search Tips   |   Advanced Search