All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.cart_total.view.jsp Maven / Gradle / Ivy

There is a newer version: 4.0.63
Show newest version
<%--
/**
 * 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" %>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy