META-INF.resources.cart_total.view.jsp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.commerce.cart.content.web
Show all versions of com.liferay.commerce.cart.content.web
Liferay Commerce Cart Content Web
<%--
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
--%>
<%@ include file="/init.jsp" %>
<%
CommerceCartContentTotalDisplayContext commerceCartContentTotalDisplayContext = (CommerceCartContentTotalDisplayContext)request.getAttribute(WebKeys.PORTLET_DISPLAY_CONTEXT);
CommerceMoney subtotalCommerceMoney = null;
CommerceMoney taxValueCommerceMoney = null;
CommerceMoney totalOrderCommerceMoney = null;
CommerceMoney totalDiscountAmountCommerceMoney = null;
CommerceMoney subtotalDiscountAmountCommerceMoney = null;
CommerceDiscountValue totalCommerceDiscountValue = null;
CommerceDiscountValue subtotalCommerceDiscountValue = null;
String priceDisplayType = commerceCartContentTotalDisplayContext.getCommercePriceDisplayType();
CommerceOrderPrice commerceOrderPrice = commerceCartContentTotalDisplayContext.getCommerceOrderPrice();
if (commerceOrderPrice != null) {
subtotalCommerceMoney = commerceOrderPrice.getSubtotal();
subtotalCommerceDiscountValue = commerceOrderPrice.getSubtotalDiscountValue();
if (subtotalCommerceDiscountValue != null) {
subtotalDiscountAmountCommerceMoney = subtotalCommerceDiscountValue.getDiscountAmount();
}
taxValueCommerceMoney = commerceOrderPrice.getTaxValue();
totalOrderCommerceMoney = commerceOrderPrice.getTotal();
totalCommerceDiscountValue = commerceOrderPrice.getTotalDiscountValue();
if (totalCommerceDiscountValue != null) {
totalDiscountAmountCommerceMoney = totalCommerceDiscountValue.getDiscountAmount();
}
if (priceDisplayType.equals(CommercePricingConstants.TAX_INCLUDED_IN_PRICE)) {
subtotalCommerceMoney = commerceOrderPrice.getSubtotalWithTaxAmount();
subtotalCommerceDiscountValue = commerceOrderPrice.getSubtotalDiscountValueWithTaxAmount();
if (subtotalCommerceDiscountValue != null) {
subtotalDiscountAmountCommerceMoney = subtotalCommerceDiscountValue.getDiscountAmount();
}
totalOrderCommerceMoney = commerceOrderPrice.getTotalWithTaxAmount();
totalCommerceDiscountValue = commerceOrderPrice.getTotalDiscountValueWithTaxAmount();
if (totalCommerceDiscountValue != null) {
totalDiscountAmountCommerceMoney = totalCommerceDiscountValue.getDiscountAmount();
}
}
}
Map contextObjects = HashMapBuilder.put(
"commerceCartContentTotalDisplayContext", commerceCartContentTotalDisplayContext
).build();
SearchContainer commerceOrderItemSearchContainer = commerceCartContentTotalDisplayContext.getSearchContainer();
%>
(<%= HtmlUtil.escape(subtotalDiscountAmountCommerceMoney.format(locale)) %>)
<%= HtmlUtil.escape(subtotalCommerceMoney.format(locale)) %>
<%= HtmlUtil.escape(taxValueCommerceMoney.format(locale)) %>
(<%= HtmlUtil.escape(totalDiscountAmountCommerceMoney.format(locale)) %>)
<%= HtmlUtil.escape(totalOrderCommerceMoney.format(locale)) %>
<%
PortletURL checkoutPortletURL = commerceCartContentTotalDisplayContext.getCheckoutPortletURL();
CommerceOrder commerceOrder = commerceCartContentTotalDisplayContext.getCommerceOrder();
%>
<%@ include file="/cart_total/request_quote.jspf" %>
<%@ include file="/common/transition.jspf" %>