Author: jacopoc
Date: Mon Apr 23 08:59:13 2007
New Revision: 531516
URL:
http://svn.apache.org/viewvc?view=rev&rev=531516Log:
Added short version of the parameter for specifying the top search category (S_TPC); now the parameter will also appear in the searchString.
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?view=diff&rev=531516&r1=531515&r2=531516==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Mon Apr 23 08:59:13 2007
@@ -492,8 +492,13 @@
}
}
+ String prioritizeCategoryId = null;
if (UtilValidate.isNotEmpty((String) parameters.get("PRIORITIZE_CATEGORY_ID"))) {
- String prioritizeCategoryId = (String) parameters.get("PRIORITIZE_CATEGORY_ID");
+ prioritizeCategoryId = (String) parameters.get("PRIORITIZE_CATEGORY_ID");
+ } else if (UtilValidate.isNotEmpty((String) parameters.get("S_TPC"))) {
+ prioritizeCategoryId = (String) parameters.get("S_TPC");
+ }
+ if (UtilValidate.isNotEmpty(prioritizeCategoryId)) {
ProductSearchOptions.setTopProductCategoryId(prioritizeCategoryId, session);
constraintsChanged = true;
}
@@ -1016,6 +1021,12 @@
}
}
+ String topProductCategoryId = productSearchOptions.getTopProductCategoryId();
+ if (topProductCategoryId != null) {
+ searchParamString.append("&S_TPC");
+ searchParamString.append("=");
+ searchParamString.append(topProductCategoryId);
+ }
ResultSortOrder resultSortOrder = productSearchOptions.getResultSortOrder();
if (resultSortOrder != null) {
if (resultSortOrder instanceof ProductSearch.SortKeywordRelevancy) {