Consultor Eletrônico



Kbase P133805: How do I get my category product counts when a search returns no products?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   30/07/2008
Status: Unverified

GOAL:

How do I get my Category product counts when a search returns no products?

GOAL:

Ecommerce application would like to display the total number of products in each category when a customer search returns no products.

FACT(s) (Environment):

EasyAsk Versions

FIX:

When a search returns no products, the XML returns -1 for the product count in each category. If the application would like to display the number of products in each category, the application should issue another request to EasyAsk that will return all products (for example, price > 0) and then the product count in each category will be returned.

Example http call:
http://localhost:9100/EasyAsk/apps/Advisor.jsp?dct=EcomDemo&RequestAction=advisor&RequestData=CA_Search&indexed=1&ResultsPerPage=10&oneshot=1&disp=XML&CatPath=All Products&q=price > 0

excerpt from returned XML:
<EA_CategoryList>


<EA_Category EA_ProductCount="256">Apparel for Her</EA_Category>

<EA_Category EA_ProductCount="170">Beauty & Fragrance</EA_Category>

<EA_Category EA_ProductCount="301">Everything for Him</EA_Category>

<EA_Category EA_ProductCount="1">Featured Items at Checkout</EA_Category>

m; TEXT-INDENT: -2em"> <EA_Category EA_ProductCount="119">Gifts & Collectibles</EA_Category>

<EA_Category EA_ProductCount="166">Home & Entertaining</EA_Category>

<EA_Category EA_ProductCount="621">Shoes, Handbags, Jewelry & More</EA_Category>

<EA_Category EA_ProductCount="173">Sale</EA_Category>
</EA_CategoryList>.