<#-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <#if productPromoId?exists && productPromo?exists>

${uiLabelMap.PageTitleEditProductPromoRules}

<#-- ======================= Rules ======================== -->
<#assign rowClass = "2"> <#list productPromoRules as productPromoRule> <#assign productPromoConds = productPromoRule.getRelated("ProductPromoCond")> <#assign productPromoActions = productPromoRule.getRelated("ProductPromoAction")> class="alternate-row">
${uiLabelMap.ProductRuleId} ${uiLabelMap.ProductRuleName}  
${(productPromoRule.productPromoRuleId)?if_exists}
  <#if (productPromoConds.size() == 0 && productPromoActions.size() == 0)>
${uiLabelMap.CommonDelete}
${uiLabelMap.ProductConditions} <#assign maxCondSeqId = 1> <#list productPromoConds as productPromoCond> <#if (productPromoCond.productPromoCondSeqId)?exists> <#assign curCondSeqId = Static["java.lang.Integer"].valueOf(productPromoCond.getString("productPromoCondSeqId"))> <#if (curCondSeqId >= maxCondSeqId)> <#assign maxCondSeqId = curCondSeqId + 1>
${(productPromoCond.productPromoCondSeqId)?if_exists}
${uiLabelMap.CommonOther}:
<#-- ======================= Categories ======================== -->
${uiLabelMap.ProductConditions} ${uiLabelMap.ProductCategories}:
<#assign condProductPromoCategories = productPromoCond.getRelated("ProductPromoCategory")> <#list condProductPromoCategories as condProductPromoCategory> <#assign condProductCategory = condProductPromoCategory.getRelatedOneCache("ProductCategory")> <#assign condApplEnumeration = condProductPromoCategory.getRelatedOneCache("ApplEnumeration")>
${(condProductCategory.get("description",locale))?if_exists} [${condProductPromoCategory.productCategoryId}] - ${(condApplEnumeration.get("description",locale))?default(condProductPromoCategory.productPromoApplEnumId)} - ${uiLabelMap.ProductSubCats}? ${condProductPromoCategory.includeSubCategories?default("N")} - ${uiLabelMap.CommonAnd} ${uiLabelMap.CommonGroup}: ${condProductPromoCategory.andGroupId}
${uiLabelMap.CommonDelete}
${uiLabelMap.CommonClickHereForFieldLookup} ${uiLabelMap.CommonAnd} ${uiLabelMap.CommonGroup}: *
<#-- ======================= Products ======================== -->
${uiLabelMap.ProductConditions} ${uiLabelMap.ProductProducts}:
<#assign condProductPromoProducts = productPromoCond.getRelated("ProductPromoProduct")> <#list condProductPromoProducts as condProductPromoProduct> <#assign condProduct = condProductPromoProduct.getRelatedOneCache("Product")?if_exists> <#assign condApplEnumeration = condProductPromoProduct.getRelatedOneCache("ApplEnumeration")>
${(condProduct.internalName)?if_exists} [${condProductPromoProduct.productId}] - ${(condApplEnumeration.get("description",locale))?default(condProductPromoProduct.productPromoApplEnumId)}
${uiLabelMap.CommonDelete}
${uiLabelMap.ProductProductId}:
${uiLabelMap.CommonDelete}
${uiLabelMap.CommonNew}  ${uiLabelMap.CommonOther}:
${uiLabelMap.ProductActions} : <#list productPromoActions as productPromoAction>
${(productPromoAction.productPromoActionSeqId)?if_exists}
${uiLabelMap.ProductQuantity}:  ${uiLabelMap.ProductAmount}:  ${uiLabelMap.ProductItemId}:  ${uiLabelMap.PartyParty}: 
<#-- ======================= Categories ======================== -->
${uiLabelMap.ProductActions} ${uiLabelMap.ProductCategories}:
<#assign actionProductPromoCategories = productPromoAction.getRelated("ProductPromoCategory")> <#list actionProductPromoCategories as actionProductPromoCategory> <#assign actionProductCategory = actionProductPromoCategory.getRelatedOneCache("ProductCategory")> <#assign actionApplEnumeration = actionProductPromoCategory.getRelatedOneCache("ApplEnumeration")>
${(actionProductCategory.description)?if_exists} [${actionProductPromoCategory.productCategoryId}] - ${(actionApplEnumeration.get("description",locale))?default(actionProductPromoCategory.productPromoApplEnumId)} - ${uiLabelMap.ProductSubCats}? ${actionProductPromoCategory.includeSubCategories?default("N")} - ${uiLabelMap.CommonAnd} ${uiLabelMap.CommonGroup}: ${actionProductPromoCategory.andGroupId}
${uiLabelMap.CommonDelete}
${uiLabelMap.CommonClickHereForFieldLookup} ${uiLabelMap.CommonAnd} ${uiLabelMap.CommonGroup}: *
<#-- ======================= Products ======================== -->
${uiLabelMap.ProductActions} ${uiLabelMap.ProductProducts}:
<#assign actionProductPromoProducts = productPromoAction.getRelated("ProductPromoProduct")> <#list actionProductPromoProducts as actionProductPromoProduct> <#assign actionProduct = actionProductPromoProduct.getRelatedOneCache("Product")?if_exists> <#assign actionApplEnumeration = actionProductPromoProduct.getRelatedOneCache("ApplEnumeration")>
${(actionProduct.internalName)?if_exists} [${actionProductPromoProduct.productId}] - ${(actionApplEnumeration.get("description",locale))?default(actionProductPromoProduct.productPromoApplEnumId)}
${uiLabelMap.CommonDelete}
${uiLabelMap.ProductProductId}:
${uiLabelMap.CommonDelete}
${uiLabelMap.CommonNew}:  ${uiLabelMap.ProductQuantity}:  ${uiLabelMap.ProductAmount}:  ${uiLabelMap.ProductItemId}:  ${uiLabelMap.PartyParty}: 
<#-- This was removed in r697962, should have been only commented out as maybe in future will be used again (free shipping promo)
${uiLabelMap.ProductNoteOnItemId} : ${uiLabelMap.ProductItemIdGiftPurchaseFreeShipping}
${uiLabelMap.ProductNoteOnPartyId} : ${uiLabelMap.ProductPartyFreeShipping}
-->

${uiLabelMap.ProductAddPromoRule}

${uiLabelMap.ProductName}

${uiLabelMap.ProductPromotion} ${uiLabelMap.ProductCategories}

<#-- ======================= Categories ======================== -->
<#list promoProductPromoCategories as promoProductPromoCategory> <#assign promoProductCategory = promoProductPromoCategory.getRelatedOneCache("ProductCategory")> <#assign promoApplEnumeration = promoProductPromoCategory.getRelatedOneCache("ApplEnumeration")>
${(promoProductCategory.description)?if_exists} [${promoProductPromoCategory.productCategoryId}] - ${(promoApplEnumeration.get("description",locale))?default(promoProductPromoCategory.productPromoApplEnumId)} - ${uiLabelMap.ProductSubCats}? ${promoProductPromoCategory.includeSubCategories?default("N")} - ${uiLabelMap.CommonAnd} ${uiLabelMap.CommonGroup}: ${promoProductPromoCategory.andGroupId}
${uiLabelMap.CommonDelete}
${uiLabelMap.CommonClickHereForFieldLookup} ${uiLabelMap.CommonAnd} ${uiLabelMap.CommonGroup}: *

${uiLabelMap.ProductPromotionProducts}

<#-- ======================= Products ======================== -->
<#list promoProductPromoProducts as promoProductPromoProduct> <#assign promoProduct = promoProductPromoProduct.getRelatedOneCache("Product")?if_exists> <#assign promoApplEnumeration = promoProductPromoProduct.getRelatedOneCache("ApplEnumeration")>
${(promoProduct.internalName)?if_exists} [${promoProductPromoProduct.productId}] - ${(promoApplEnumeration.get("description",locale))?default(promoProductPromoProduct.productPromoApplEnumId)}
${uiLabelMap.CommonDelete}
${uiLabelMap.ProductProductId}*${uiLabelMap.CommonClickHereForFieldLookup}