META-INF.resources.cart.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" %>
<%
CommerceCartContentDisplayContext commerceCartContentDisplayContext = (CommerceCartContentDisplayContext)request.getAttribute(WebKeys.PORTLET_DISPLAY_CONTEXT);
Map contextObjects = HashMapBuilder.put(
"commerceCartContentDisplayContext", commerceCartContentDisplayContext
).build();
SearchContainer commerceOrderItemSearchContainer = commerceCartContentDisplayContext.getSearchContainer();
PortletURL portletURL = PortletURLBuilder.create(
commerceCartContentDisplayContext.getPortletURL()
).setParameter(
"searchContainerId", "commerceOrderItems"
).buildPortletURL();
request.setAttribute("view.jsp-portletURL", portletURL);
List commerceOrderValidatorResults = new ArrayList<>();
Map> commerceOrderValidatorResultsMap = commerceCartContentDisplayContext.getCommerceOrderValidatorResults();
%>
<%
CommerceOrderValidatorException commerceOrderValidatorException = (CommerceOrderValidatorException)errorException;
if (commerceOrderValidatorException != null) {
commerceOrderValidatorResults = commerceOrderValidatorException.getCommerceOrderValidatorResults();
}
for (CommerceOrderValidatorResult commerceOrderValidatorResult : commerceOrderValidatorResults) {
%>
<%
}
%>
<%
CPInstance cpInstance = commerceOrderItem.fetchCPInstance();
long cpDefinitionId = 0;
StringJoiner stringJoiner = new StringJoiner(StringPool.COMMA);
String cpInstanceCDNURL = commerceCartContentDisplayContext.getCPInstanceCDNURL(commerceOrderItem);
if (cpInstance != null) {
CPDefinition cpDefinition = commerceOrderItem.getCPDefinition();
cpDefinitionId = cpDefinition.getCPDefinitionId();
for (KeyValuePair keyValuePair : commerceCartContentDisplayContext.getKeyValuePairs(commerceOrderItem.getCPDefinitionId(), commerceOrderItem.getJson(), locale)) {
stringJoiner.add(keyValuePair.getValue());
}
}
%>
<%= HtmlUtil.escape(commerceOrderItem.getName(languageId)) %>
<%= HtmlUtil.escape(stringJoiner.toString()) %>
<%
commerceOrderValidatorResults = commerceOrderValidatorResultsMap.get(commerceOrderItem.getCommerceOrderItemId());
for (CommerceOrderValidatorResult commerceOrderValidatorResult : commerceOrderValidatorResults) {
%>
<%
}
%>
<%
CommerceMoney unitPriceCommerceMoney = commerceCartContentDisplayContext.getUnitPriceCommerceMoney(commerceOrderItem);
CommerceMoney unitPromoPriceCommerceMoney = commerceCartContentDisplayContext.getUnitPromoPriceCommerceMoney(commerceOrderItem);
%>
<%= HtmlUtil.escape(unitPromoPriceCommerceMoney.format(locale)) %>
<%= HtmlUtil.escape(unitPriceCommerceMoney.format(locale)) %>
<%
CommerceMoney discountAmountCommerceMoney = commerceCartContentDisplayContext.getDiscountAmountCommerceMoney(commerceOrderItem);
%>
<%= HtmlUtil.escape(discountAmountCommerceMoney.format(locale)) %>
<%
CommerceMoney finalPriceCommerceMoney = commerceCartContentDisplayContext.getFinalPriceCommerceMoney(commerceOrderItem);
%>
<%= HtmlUtil.escape(finalPriceCommerceMoney.format(locale)) %>