All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
META-INF.resources.commerce_order.edit_billing_address.jsp Maven / Gradle / Ivy
<%--
/**
* 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" %>
<%
String cmd = ParamUtil.getString(request, Constants.CMD);
CommerceOrderEditDisplayContext commerceOrderEditDisplayContext = (CommerceOrderEditDisplayContext)request.getAttribute(WebKeys.PORTLET_DISPLAY_CONTEXT);
CommerceAddress billingAddress = null;
CommerceOrder commerceOrder = commerceOrderEditDisplayContext.getCommerceOrder();
if ((commerceOrder != null) && Validator.isNull(cmd)) {
billingAddress = commerceOrder.getBillingAddress();
}
%>
new Liferay.DynamicSelect([
{
select: ' countryId',
selectData: function (callback) {
function injectCountryPlaceholder(list) {
var callbackList = [
{
countryId: '0',
nameCurrentValue:
'- ',
},
];
list.forEach((listElement) => {
callbackList.push(listElement);
});
callback(callbackList);
}
Liferay.Service(
'/commerce.commercecountrymanagerimpl/get-billing-countries',
{
active: true,
billingAllowed: true,
companyId: '<%= company.getCompanyId() %>',
},
injectCountryPlaceholder
);
},
selectDesc: 'nameCurrentValue',
selectId: 'countryId',
selectNullable: <%= false %>,
selectSort: '<%= true %>',
selectVal:
'<%= BeanParamUtil.getLong(billingAddress, request, "countryId") %>',
},
{
select: ' regionId',
selectData: function (callback, selectKey) {
function injectRegionPlaceholder(list) {
var callbackList = [
{
regionId: '0',
name: '- ',
nameCurrentValue:
'- ',
},
];
list.forEach((listElement) => {
callbackList.push(listElement);
});
callback(callbackList);
}
Liferay.Service(
'/region/get-regions',
{
active: true,
countryId: Number(selectKey),
},
injectRegionPlaceholder
);
},
selectDesc: 'name',
selectId: 'regionId',
selectNullable: <%= false %>,
selectVal:
'<%= BeanParamUtil.getLong(billingAddress, request, "regionId") %>',
},
]);