PDA

View Full Version : getproductlist


the-ferret
17-08-08, 20:59
Need some help using getProductList in the soap api v2. All working by messing with the php example from the AW website

$aParams7 = array("sQuery" => "ferret", "bAdult" => False, "iLimit"=>10, "sSort" => "relevancy");
$oResponse= $oClient->call('getProductList', $aParams7);
$count = $oResponse->iTotalCount;
echo "We found ".$count." products<br>";
echo"Here they are<BR><BR>";
echo"<table>";
foreach($oResponse->oProduct as $details){
$name = $details->sName;
$price = $details->fPrice;
$image = $details->sAwThumbUrl;
echo "<tr><td>".$name."</td><td>".$price."</td><td><img src='".$image."'></td></tr>";
}
echo "</table>";


How do I search on 1 or a number of merchants or restrict the search by 1 or more categories?

Couldn't see anything in the documentation for getProductList, unless I can do something with the refinebygroup but can see how to set it.

cheers
Graham

B544
02-09-08, 20:22
I'm no php expert, so I won't attempt to provide code, put rather have provided an example SOAP body.

By trial and error, I established that the API seems only to filter on up to one merchant and up to one brand. (I wanted the user to be able to select multiple stores for comparison purposes, but that didn't seem to work).

You need to use oActiveRefineByGroup, complete with a nested oRefineByDefinition. In the example below, I've filtered on category 61 (computers & software), merchant 1597 (Dixons) and brand 9 (Apple) (the API doesn't seem to care about the input SName values, but it does care about the numbers).


<soapenv:Body>
<getProductList>
<bAdult>false</bAdult>
<bHotPick>false</bHotPick>
<bIncludeTree>true</bIncludeTree>
<sSort>relevancy</sSort>
<iLimit>100</iLimit>
<oActiveRefineByGroup>
<iId>4</iId>
<sName>Category</sName>
<oRefineByDefinition>
<sId>61</sId>
<sName>CategoryName</sName>
</oRefineByDefinition>
</oActiveRefineByGroup>
<oActiveRefineByGroup>
<iId>3</iId>
<sName>Merchant</sName>
<oRefineByDefinition>
<sId>1597</sId>
<sName>Merchant0</sName>
</oRefineByDefinition>
</oActiveRefineByGroup>
<oActiveRefineByGroup>
<iId>2</iId>
<sName>Brand</sName>
<oRefineByDefinition>
<sId>9</sId>
<sName>Brand0</sName>
</oRefineByDefinition>
</oActiveRefineByGroup>
<iLimitRefineBy>100</iLimitRefineBy>
</getProductList>
</soapenv:Body>

andyc
04-09-08, 15:55
There are examples using the oActiveRefineByGroup parameter in the example doc (http://www.shopwindowforum.com/showthread.php?t=819) and also in ps_client.php if you've downloaded the PHP API Client.

As far as I can tell you can't yet refine by multiple merchants but I'm pursuing this and will post when I find out more.

Andy

andyc
08-09-08, 16:19
As promised - I've just received a reply from support to say that it is not possible to refine a search by more than one merchant.

Andy