You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2011/01/29 11:43:46 UTC
svn commit: r1064996 -
/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
Author: jleroux
Date: Sat Jan 29 10:43:46 2011
New Revision: 1064996
URL: http://svn.apache.org/viewvc?rev=1064996&view=rev
Log:
A patch from Amit Sharma "Wrong number of products coming in layered navigation functionality" (https://issues.apache.org/jira/browse/OFBIZ-3839) - OFBIZ-3839
Wrong number of products coming in layered navigation functionality.
Here is the steps to verify :-
1. Enable layered navigation by uncommenting layered section in category screen of CatalogScreens.xml.
2. Go to http://localhost:8080/ecommerce/control/main
3. Press Gizmos category from browse category section.
4. Now Layered Navigation section will show it sub category and features with number of products. Like :-
* Categories
o Large Gizmos (12)
o Small Gizmos (14)
* Price Range
o $0.00 - $10.00 (4)
o $10.00 - $20.00 (2)
5. Click on Large Gizmos category.
6. Now category details shows only 6 products.
There are only 6 products in large gizmos category but it shows 12 products, which is wrong behavior.
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java?rev=1064996&r1=1064995&r2=1064996&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Sat Jan 29 10:43:46 2011
@@ -1197,7 +1197,7 @@ public class ProductSearchSession {
dynamicViewEntity.addAlias("PFAC", "pfacProductFeatureId", "productFeatureId", null, null, Boolean.TRUE, null);
dynamicViewEntity.addAlias("PFAC", "pfacFromDate", "fromDate", null, null, null, null);
dynamicViewEntity.addAlias("PFAC", "pfacThruDate", "thruDate", null, null, null, null);
- dynamicViewEntity.addAlias("PFAC", "featureCount", "productId", null, null, null, "count");
+ dynamicViewEntity.addAlias("PFAC", "featureCount", "productId", null, null, null, "count-distinct");
dynamicViewEntity.addViewLink("PROD", "PFAC", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"));
fieldsToSelect.add("pfacProductFeatureId");
fieldsToSelect.add("featureCount");
@@ -1281,7 +1281,7 @@ public class ProductSearchSession {
dynamicViewEntity.addAlias("PPC", "ppcFromDate", "fromDate", null, null, null, null);
dynamicViewEntity.addAlias("PPC", "ppcThruDate", "thruDate", null, null, null, null);
dynamicViewEntity.addAlias("PPC", "ppcPrice", "price", null, null, null, null);
- dynamicViewEntity.addAlias("PPC", "priceRangeCount", "productId", null, null, null, "count");
+ dynamicViewEntity.addAlias("PPC", "priceRangeCount", "productId", null, null, null, "count-distinct");
dynamicViewEntity.addViewLink("PROD", "PPC", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"));
fieldsToSelect.add("priceRangeCount");
entityConditionList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("ppcThruDate", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("ppcThruDate", EntityOperator.GREATER_THAN, UtilDateTime.nowTimestamp())));
@@ -1346,7 +1346,7 @@ public class ProductSearchSession {
dynamicViewEntity.addAlias("PCMC", "pcmcProductCategoryId", "productCategoryId", null, null, null, null);
dynamicViewEntity.addAlias("PCMC", "pcmcFromDate", "fromDate", null, null, null, null);
dynamicViewEntity.addAlias("PCMC", "pcmcThruDate", "thruDate", null, null, null, null);
- dynamicViewEntity.addAlias("PCMC", "categoryCount", "productId", null, null, null, "count");
+ dynamicViewEntity.addAlias("PCMC", "categoryCount", "productId", null, null, null, "count-distinct");
dynamicViewEntity.addViewLink("PROD", "PCMC", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"));
fieldsToSelect.add("categoryCount");
entityConditionList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("pcmcThruDate", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("pcmcThruDate", EntityOperator.GREATER_THAN, productSearchContext.nowTimestamp)));