META-INF.resources.cart_mini.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" %>
<%
CommerceCartContentMiniDisplayContext commerceCartContentMiniDisplayContext = (CommerceCartContentMiniDisplayContext)request.getAttribute(WebKeys.PORTLET_DISPLAY_CONTEXT);
Map contextObjects = HashMapBuilder.put(
"commerceCartContentMiniDisplayContext", commerceCartContentMiniDisplayContext
).build();
CommerceMoney subtotalCommerceMoney = null;
CommerceDiscountValue subtotalCommerceDiscountValue = null;
CommerceMoney taxValueCommerceMoney = null;
CommerceDiscountValue totalCommerceDiscountValue = null;
CommerceMoney totalOrderCommerceMoney = null;
String priceDisplayType = commerceCartContentMiniDisplayContext.getCommercePriceDisplayType();
CommerceOrderPrice commerceOrderPrice = commerceCartContentMiniDisplayContext.getCommerceOrderPrice();
if (commerceOrderPrice != null) {
subtotalCommerceMoney = commerceOrderPrice.getSubtotal();
subtotalCommerceDiscountValue = commerceOrderPrice.getSubtotalDiscountValue();
taxValueCommerceMoney = commerceOrderPrice.getTaxValue();
totalCommerceDiscountValue = commerceOrderPrice.getTotalDiscountValue();
totalOrderCommerceMoney = commerceOrderPrice.getTotal();
if (priceDisplayType.equals(CommercePricingConstants.TAX_INCLUDED_IN_PRICE)) {
subtotalCommerceMoney = commerceOrderPrice.getSubtotalWithTaxAmount();
subtotalCommerceDiscountValue = commerceOrderPrice.getSubtotalDiscountValueWithTaxAmount();
totalCommerceDiscountValue = commerceOrderPrice.getTotalDiscountValueWithTaxAmount();
totalOrderCommerceMoney = commerceOrderPrice.getTotalWithTaxAmount();
}
}
SearchContainer commerceOrderItemSearchContainer = commerceCartContentMiniDisplayContext.getSearchContainer();
PortletURL portletURL = PortletURLBuilder.create(
commerceCartContentMiniDisplayContext.getPortletURL()
).setParameter(
"searchContainerId", "commerceOrderItems"
).buildPortletURL();
request.setAttribute("view.jsp-portletURL", portletURL);
%>
-
<%
CPDefinition cpDefinition = commerceOrderItem.getCPDefinition();
String cpInstanceCDNURL = commerceCartContentMiniDisplayContext.getCPInstanceCDNURL(commerceOrderItem);
%>
<%
StringJoiner stringJoiner = new StringJoiner(StringPool.COMMA);
for (KeyValuePair keyValuePair : commerceCartContentMiniDisplayContext.getKeyValuePairs(commerceOrderItem.getCPDefinitionId(), commerceOrderItem.getJson(), locale)) {
stringJoiner.add(keyValuePair.getValue());
}
%>
<%= HtmlUtil.escape(stringJoiner.toString()) %>
<%
CPInstance cpInstance = commerceOrderItem.fetchCPInstance();
%>
<%= commerceOrderItem.getQuantity() %>x
<%
CommerceMoney unitPriceCommerceMoney = commerceCartContentMiniDisplayContext.getUnitPriceCommerceMoney(commerceOrderItem);
CommerceMoney unitPromoPriceCommerceMoney = commerceCartContentMiniDisplayContext.getUnitPromoPriceCommerceMoney(commerceOrderItem);
%>
<%= HtmlUtil.escape(unitPromoPriceCommerceMoney.format(locale)) %>
<%= HtmlUtil.escape(unitPriceCommerceMoney.format(locale)) %>
<%@ include file="/common/transition.jspf" %>