ストア・サービスの「課税カテゴリー」ページで、商品の表示価格に税を含めるオプションを選択できます。 商品ページ (または価格を表示するいずれかのページ) 上でこの価格を表示するには、 JSP ファイルに以下のコードを組み込んでください。
BigDecimal oldPrice =
product.getCalculatedPrice().getPrimaryPrice().getValue();
CategorizedMonetaryAmountsDataBean cMADB = product.getDisplayTaxes();
BigDecimal taxAmount = cMADB.getCategoryAmount();
BigDecimal TotalPriceWithTax = oldPrice.add(cMADB.getCategoryAmount());
FormattedMonetaryAmountDataBean formattedAmount = new
FormattedMonetaryAmountDataBean(); formattedAmount.setAmount(TotalPriceWithTax);
com.ibm.commerce.beans.DataBeanManager.activate (formattedAmount, commandContext);
両方の価格 (税込みおよび税抜き) を表示するには、以下のコードを組み込みます。
<font class="Was">regularPrice : <%=product.getCalculatedPrice()%></font><br> <font class="Was">Total Price With Tax : <%=formattedAmount%></font><br>
![]() |