diff --git a/applications/product/config/ProductUiLabels.properties b/applications/product/config/ProductUiLabels.properties index a238577654..dd683a5c50 100644 --- a/applications/product/config/ProductUiLabels.properties +++ b/applications/product/config/ProductUiLabels.properties @@ -289,7 +289,7 @@ ProductAddProductsUsingDefaultQuantities=Add Products in this Category to the Ca ProductAddPromoRule=Add New Promo Rule ProductAddResultsTo=Add Results To ProductAddRouteSegmentInfo=Add Route Segment Info -ProductAddStorePromo=Add Store Promo (select Store, enter optional From Date) +ProductAddStorePromo=Add Store Promo ProductAddStorePromoOptionalDate=Add Store Promo (select Promo, enter optional From Date) ProductAddFeatureToCategory=new features to this category ProductAddFeature=Add Feature diff --git a/applications/product/entitydef/entitymodel.xml b/applications/product/entitydef/entitymodel.xml index b0d5b355cc..96a772d6c4 100644 --- a/applications/product/entitydef/entitymodel.xml +++ b/applications/product/entitydef/entitymodel.xml @@ -3739,6 +3739,12 @@ under the License. + + + If set to Y then the promotion is not automatically evaluated, but only if it + is manually added to the cart. + + diff --git a/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStorePromos.bsh b/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStorePromos.bsh deleted file mode 100644 index 8b583a8b98..0000000000 --- a/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStorePromos.bsh +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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. - */ - -import java.util.*; -import java.io.*; -import org.ofbiz.entity.*; -import org.ofbiz.entity.util.*; -import org.ofbiz.base.util.*; -import org.ofbiz.widget.html.*; - -activeOnly = !"false".equals(request.getParameter("activeOnly")); -userEntered = !"false".equals(request.getParameter("userEntered")); - -nowTimestampString = UtilDateTime.nowTimestamp().toString(); - -productStorePromoAndAppls = null; -if (productStore != null) { - constraintMap = UtilMisc.toMap("productStoreId", productStoreId); - if (userEntered) { - constraintMap.put("userEntered", "Y"); - } - productStorePromoAndAppls = delegator.findByAnd("ProductStorePromoAndAppl", constraintMap, UtilMisc.toList("sequenceNum", "productPromoId")); - if (activeOnly) { - productStorePromoAndAppls = EntityUtil.filterByDate(productStorePromoAndAppls); - } -} - -productPromos = delegator.findByAnd("ProductPromo", UtilMisc.toMap("userEntered", "Y"), UtilMisc.toList("promoName")); - -context.put("activeOnly", activeOnly); -context.put("userEntered", userEntered); -context.put("nowTimestampString", nowTimestampString); -context.put("productStorePromoAndAppls", productStorePromoAndAppls); -context.put("productPromos", productPromos); - -int viewIndex = 0; -int viewSize = 20; -int highIndex = 0; -int lowIndex = 0; -int listSize = 0; - -try { - viewIndex = Integer.valueOf((String) parameters.get("VIEW_INDEX")).intValue(); -} catch (Exception e) { - viewIndex = 0; -} - -try { - viewSize = Integer.valueOf((String) parameters.get("VIEW_SIZE")).intValue(); -} catch (Exception e) { - viewSize = 20; -} - -if (productStorePromoAndAppls != null) { - listSize = productStorePromoAndAppls.size(); -} - -lowIndex = viewIndex * viewSize; -highIndex = (viewIndex + 1) * viewSize; -if (listSize < highIndex) { - highIndex = listSize; -} - -context.put("viewIndex", viewIndex); -context.put("viewSize", viewSize); -context.put("listSize", listSize); -context.put("lowIndex", lowIndex); -context.put("highIndex", highIndex); diff --git a/applications/product/webapp/catalog/store/EditProductStorePromos.ftl b/applications/product/webapp/catalog/store/EditProductStorePromos.ftl deleted file mode 100644 index a56c71807f..0000000000 --- a/applications/product/webapp/catalog/store/EditProductStorePromos.ftl +++ /dev/null @@ -1,131 +0,0 @@ -<#-- -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 activeOnly> - [${uiLabelMap.CommonActiveInactive}] - <#else> - [${uiLabelMap.CommonActiveOnly}] - - <#if userEntered> - [${uiLabelMap.CommonUserAutoEntered}] - <#else> - [${uiLabelMap.CommonUserEnteredOnly}] - -
-

${uiLabelMap.CommonShow} - <#if activeOnly>${uiLabelMap.CommonActiveOnly}<#else>${uiLabelMap.CommonActiveInactive} - ${uiLabelMap.CommonAnd} - <#if userEntered>${uiLabelMap.CommonUserEnteredOnly}<#else>${uiLabelMap.CommonUserAutoEntered} -

- - <#if productStoreId?exists && productStore?exists> - <#if (listSize > 0)> - - - - -
- - <#if (viewIndex > 0)> - [${uiLabelMap.CommonPrevious}] | - - <#if (listSize > 0)> - ${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} - - <#if (listSize > highIndex)> - | [${uiLabelMap.CommonNext}] - - -
- - - - - - - - - - <#if (listSize > 0)> - <#assign line = 0> - <#list productStorePromoAndAppls[lowIndex..highIndex-1] as productStorePromoAndAppl> - <#assign line = line+1> - - - <#assign hasntStarted = false> - <#if productStorePromoAndAppl.getTimestamp("fromDate")?exists && Static["org.ofbiz.base.util.UtilDateTime"].nowTimestamp().before(productStorePromoAndAppl.getTimestamp("fromDate"))> <#assign hasntStarted = true> - - - - - - -
${uiLabelMap.ProductPromoNameId}
${uiLabelMap.CommonFromDateTime}
${uiLabelMap.ProductThruDateTimeSequence}
 
${(productStorePromoAndAppl.promoName)?if_exists} [${(productStorePromoAndAppl.productPromoId)?if_exists}]
style="color: red;" >${productStorePromoAndAppl.getTimestamp("fromDate").toString()}
- <#assign hasExpired = false> - <#if productStorePromoAndAppl.getTimestamp("thruDate")?exists && Static["org.ofbiz.base.util.UtilDateTime"].nowTimestamp().after(productStorePromoAndAppl.getTimestamp("thruDate"))> <#assign hasExpired = true> -
- - - - - Calendar - - -
-
- " class="buttontext"> - [${uiLabelMap.CommonDelete}] -
- <#if (listSize > 0)> - - - - -
- - <#if (viewIndex > 0)> - [${uiLabelMap.CommonPrevious}] | - - <#if (listSize > 0)> - ${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize} - - <#if (listSize > highIndex)> - | [${uiLabelMap.CommonNext}] - - -
- - -
-
- - - -

${uiLabelMap.ProductAddStorePromoOptionalDate}:

-
- ${uiLabelMap.ProductNoteUserPromotionEntered} -
- - Calendar - -
- diff --git a/applications/product/webapp/catalog/store/ProductStoreForms.xml b/applications/product/webapp/catalog/store/ProductStoreForms.xml index 76538e30aa..b793df8e42 100644 --- a/applications/product/webapp/catalog/store/ProductStoreForms.xml +++ b/applications/product/webapp/catalog/store/ProductStoreForms.xml @@ -771,4 +771,40 @@ + +
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + +
diff --git a/applications/product/widget/catalog/PromoScreens.xml b/applications/product/widget/catalog/PromoScreens.xml index 6d48cae3c3..8d9e9d6456 100755 --- a/applications/product/widget/catalog/PromoScreens.xml +++ b/applications/product/widget/catalog/PromoScreens.xml @@ -88,7 +88,7 @@ under the License. - + diff --git a/applications/product/widget/catalog/StoreScreens.xml b/applications/product/widget/catalog/StoreScreens.xml index e3bc7e3e42..5754c6fec7 100755 --- a/applications/product/widget/catalog/StoreScreens.xml +++ b/applications/product/widget/catalog/StoreScreens.xml @@ -100,14 +100,37 @@ under the License. -