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

META-INF.resources.checkout_step.order_summary.jsp Maven / Gradle / Ivy

There is a newer version: 5.0.100
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" %>

<%
CheckoutDisplayContext checkoutDisplayContext = (CheckoutDisplayContext)request.getAttribute(WebKeys.PORTLET_DISPLAY_CONTEXT);

CommerceContext commerceContext = (CommerceContext)request.getAttribute(CommerceWebKeys.COMMERCE_CONTEXT);

AccountEntry accountEntry = commerceContext.getAccountEntry();

OrderSummaryCheckoutStepDisplayContext orderSummaryCheckoutStepDisplayContext = (OrderSummaryCheckoutStepDisplayContext)request.getAttribute(CommerceCheckoutWebKeys.COMMERCE_CHECKOUT_STEP_DISPLAY_CONTEXT);

CommerceOrder commerceOrder = orderSummaryCheckoutStepDisplayContext.getCommerceOrder();

CommerceOrderPrice commerceOrderPrice = orderSummaryCheckoutStepDisplayContext.getCommerceOrderPrice();

CommerceDiscountValue shippingDiscountValue = commerceOrderPrice.getShippingDiscountValue();
CommerceMoney shippingValueCommerceMoney = commerceOrderPrice.getShippingValue();
CommerceMoney subtotalCommerceMoney = commerceOrderPrice.getSubtotal();
CommerceDiscountValue subtotalCommerceDiscountValue = commerceOrderPrice.getSubtotalDiscountValue();
CommerceMoney taxValueCommerceMoney = commerceOrderPrice.getTaxValue();
CommerceDiscountValue totalCommerceDiscountValue = commerceOrderPrice.getTotalDiscountValue();
CommerceMoney totalOrderCommerceMoney = commerceOrderPrice.getTotal();

String priceDisplayType = orderSummaryCheckoutStepDisplayContext.getCommercePriceDisplayType();

if (priceDisplayType.equals(CommercePricingConstants.TAX_INCLUDED_IN_PRICE)) {
	shippingDiscountValue = commerceOrderPrice.getShippingDiscountValueWithTaxAmount();
	shippingValueCommerceMoney = commerceOrderPrice.getShippingValueWithTaxAmount();
	subtotalCommerceMoney = commerceOrderPrice.getSubtotalWithTaxAmount();
	subtotalCommerceDiscountValue = commerceOrderPrice.getSubtotalDiscountValueWithTaxAmount();
	totalCommerceDiscountValue = commerceOrderPrice.getTotalDiscountValueWithTaxAmount();
	totalOrderCommerceMoney = commerceOrderPrice.getTotalWithTaxAmount();
}

Map> commerceOrderValidatorResultsMap = orderSummaryCheckoutStepDisplayContext.getCommerceOrderValidatorResultsMap();
%>

<% CPDefinition cpDefinition = commerceOrderItem.getCPDefinition(); String cpInstanceCDNURL = orderSummaryCheckoutStepDisplayContext.getCPInstanceCDNURL(commerceOrderItem); %> thumbnail
<%= HtmlUtil.escape(cpDefinition.getName(themeDisplay.getLanguageId())) %>
<% StringJoiner stringJoiner = new StringJoiner(StringPool.COMMA); for (KeyValuePair keyValuePair : orderSummaryCheckoutStepDisplayContext.getKeyValuePairs(commerceOrderItem.getCPDefinitionId(), commerceOrderItem.getJson(), locale)) { stringJoiner.add(keyValuePair.getValue()); } %>
<%= HtmlUtil.escape(stringJoiner.toString()) %>
<% List commerceOrderValidatorResults = commerceOrderValidatorResultsMap.get(commerceOrderItem.getCommerceOrderItemId()); for (CommerceOrderValidatorResult commerceOrderValidatorResult : commerceOrderValidatorResults) { %>
<% } %>
<%= orderSummaryCheckoutStepDisplayContext.getCommerceOrderItemFormattedQuantity(commerceOrderItem) %>x
<%= HtmlUtil.escape(commerceOrderItem.getUnitOfMeasureKey()) %>
<% CommerceProductPrice commerceProductPrice = orderSummaryCheckoutStepDisplayContext.getCommerceProductPrice(commerceOrderItem); CPInstance cpInstance = commerceOrderItem.fetchCPInstance(); %> <% CommerceMoney unitPriceCommerceMoney = commerceProductPrice.getUnitPrice(); CommerceMoney unitPromoPriceCommerceMoney = commerceProductPrice.getUnitPromoPrice(); if (priceDisplayType.equals(CommercePricingConstants.TAX_INCLUDED_IN_PRICE)) { unitPriceCommerceMoney = commerceProductPrice.getUnitPriceWithTaxAmount(); unitPromoPriceCommerceMoney = commerceProductPrice.getUnitPromoPriceWithTaxAmount(); } %>
<%= HtmlUtil.escape(unitPromoPriceCommerceMoney.format(locale)) %> <%= HtmlUtil.escape(unitPriceCommerceMoney.format(locale)) %> <%= HtmlUtil.escape(unitPriceCommerceMoney.format(locale)) %>
<% CommerceDiscountValue discountValue = commerceProductPrice.getDiscountValue(); if (priceDisplayType.equals(CommercePricingConstants.TAX_INCLUDED_IN_PRICE)) { discountValue = commerceProductPrice.getDiscountValueWithTaxAmount(); } CommerceMoney discountAmountCommerceMoney = null; if (discountValue != null) { discountAmountCommerceMoney = discountValue.getDiscountAmount(); } %>
<%= (discountAmountCommerceMoney == null) ? StringPool.BLANK : HtmlUtil.escape(discountAmountCommerceMoney.format(locale)) %>
<% CommerceMoney finalPriceCommerceMoney = commerceProductPrice.getFinalPrice(); if (priceDisplayType.equals(CommercePricingConstants.TAX_INCLUDED_IN_PRICE)) { finalPriceCommerceMoney = commerceProductPrice.getFinalPriceWithTaxAmount(); } %>
<%= HtmlUtil.escape(finalPriceCommerceMoney.format(locale)) %>
<% CommerceAddress shippingAddress = commerceOrder.getShippingAddress(); %>
<% request.setAttribute("address.jsp-commerceAddress", shippingAddress); %> <%= HtmlUtil.escape(shippingAddress.getName()) %>
<%= HtmlUtil.escape(shippingAddress.getStreet1()) %>
<%= HtmlUtil.escape(shippingAddress.getStreet2()) %>
<%= HtmlUtil.escape(shippingAddress.getStreet3()) %>
<%= HtmlUtil.escape(shippingAddress.getCity()) %>
<%= HtmlUtil.escape(shippingAddress.getZip()) %>
<% Region region = shippingAddress.getRegion(); %> <%= HtmlUtil.escape(region.getTitle()) %>
<% Country country = shippingAddress.getCountry(); %> <%= HtmlUtil.escape(country.getTitle(locale)) %>
<%= HtmlUtil.escape(shippingAddress.getPhoneNumber()) %>
<% int requestedDeliveryDay = 0; int requestedDeliveryMonth = -1; int requestedDeliveryYear = 0; Date requestedDeliveryDate = commerceOrder.getRequestedDeliveryDate(); if (requestedDeliveryDate != null) { Calendar calendar = CalendarFactoryUtil.getCalendar(requestedDeliveryDate.getTime()); requestedDeliveryDay = calendar.get(Calendar.DAY_OF_MONTH); requestedDeliveryMonth = calendar.get(Calendar.MONTH); requestedDeliveryYear = calendar.get(Calendar.YEAR); } %>
<% CommerceAddress commerceBillingAddress = commerceOrder.getBillingAddress(); %>
<% request.setAttribute("address.jsp-commerceAddress", commerceBillingAddress); %> <%= HtmlUtil.escape(commerceBillingAddress.getName()) %>
<%= HtmlUtil.escape(commerceBillingAddress.getStreet1()) %>
<%= HtmlUtil.escape(commerceBillingAddress.getStreet2()) %>
<%= HtmlUtil.escape(commerceBillingAddress.getStreet3()) %>
<%= HtmlUtil.escape(commerceBillingAddress.getCity()) %>
<%= HtmlUtil.escape(commerceBillingAddress.getZip()) %>
<% Region region = commerceBillingAddress.getRegion(); %> <%= HtmlUtil.escape(region.getTitle()) %>
<% Country country = commerceBillingAddress.getCountry(); %> <%= HtmlUtil.escape(country.getTitle(locale)) %>
<%= HtmlUtil.escape(commerceBillingAddress.getPhoneNumber()) %>
<% String commerceShippingOptionName = StringPool.BLANK; if (commerceOrder.getShippingOptionName() != null) { commerceShippingOptionName = orderSummaryCheckoutStepDisplayContext.getShippingOptionName(locale); } %>
<%= HtmlUtil.escape(commerceShippingOptionName) %>
<%= HtmlUtil.escape(shippingValueCommerceMoney.format(locale)) %>
<% String commercePaymentMethodName = StringPool.BLANK; if (commerceOrder.getCommercePaymentMethodKey() != null) { commercePaymentMethodName = orderSummaryCheckoutStepDisplayContext.getPaymentMethodName(commerceOrder.getCommercePaymentMethodKey(), locale); } %>
<%= HtmlUtil.escape(commercePaymentMethodName) %>
<% String deliveryTermEntryName = orderSummaryCheckoutStepDisplayContext.getDeliveryTermEntryName(locale); %> <% String paymentTermEntryName = orderSummaryCheckoutStepDisplayContext.getPaymentTermEntryName(locale); %>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy