Skip to content

Commit

Permalink
Add searching for productCategoryIds in getProductList transition (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshp committed Jun 15, 2022
1 parent 7e434e1 commit a06168c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions template/product/ProductTransitions.xml
Expand Up @@ -19,6 +19,7 @@ along with this software (see the LICENSE.md file). If not, see
<parameter name="productFeatureIds"/>
<parameter name="productTypeEnumId"/>
<parameter name="productClassEnumId"/>
<parameter name="productCategoryIds"/>
<parameter name="assetTypeEnumId"/>
<parameter name="assetClassEnumId"/>
<parameter name="indexName"/>
Expand Down Expand Up @@ -63,6 +64,16 @@ along with this software (see the LICENSE.md file). If not, see
}
if (productFeatureIdList.size() > 1) termSb.append(')')
}
if (productCategoryIds) {
List productCategoryIdList = productCategoryIds.split(',')
termSb.append(' AND categories.productCategoryId:')
if (productCategoryIdList.size() > 1) termSb.append('(')
for (int i = 0; i < productCategoryIdList.size(); i++) {
termSb.append(productCategoryIdList.get(i))
if (i < (productCategoryIdList.size() - 1)) termSb.append(' OR ')
}
if (productCategoryIdList.size() > 1) termSb.append(')')
}
if (productTypeEnumId) termSb.append(' AND productTypeEnumId:').append(productTypeEnumId)
if (productClassEnumId) termSb.append(' AND productClassEnumId:').append(productClassEnumId)
if (assetTypeEnumId) termSb.append(' AND assetTypeEnumId:').append(assetTypeEnumId)
Expand Down

0 comments on commit a06168c

Please sign in to comment.