View Full Version : send a request but only recieve/output the products where artist = something???
ljackson09
26-09-09, 13:51
Hi All,
ok its something that im really stuck on, im trying recieve a set of results where for example if i search in cds for Only by the Night by Kings of Leon how do i get back just the cds by kings of leon as at the moment im getting the odd cd from someone else. is there a way to include the artist in the product call somehow? or could i do an if($oProduct->Artist = "Kings of Leon")? i know this wasnt available in V2 has it been addressed for V3?
many thanks
Luke
currentstyle
27-09-09, 11:08
There are ways around it Luke, for example, use a category based query, along with a boolean search mode and remove the keywords that are showing things which don't match your expected results.
$oRefineBy = new stdClass();
$oRefineBy->iId = 4;
$oRefineBy->sName = '';
$oRefineByDefinition = new stdClass();
$oRefineByDefinition->sId = 241;
$oRefineByDefinition->sName = '';
$oRefineBy->oRefineByDefinition = $oRefineByDefinition;
$returnedcolumns = array(sAwImageUrl,sDescription,sBrand,iMerchantId, iCategoryId);
$boolean_product_search_params = array("sQuery" => "Only Night Kings Leon -living -cigarettes", "bHotPick" => false, "iAdult" => 1, "iLimit"=>20, "sColumnToReturn" => $returnedcolumns, "oActiveRefineByGroup" => $oRefineBy, "bIncludeTree" => true, "sMode" => boolean );
$oResponse= $oClient->call('getProductList', $boolean_product_search_params);
Thats shows me 3 Only by the Night by Kings of Leon (http://www.easynewshop.com/boolean.php) items
ljackson09
27-09-09, 20:26
Hi mate thanks for your reply :)
im obviously doing something drastically wrong as i cannot get anything to display :(
here is my code
$oRefineBy = new stdClass();
$oRefineBy->iId = 4;
$oRefineBy->sName = '';
$oRefineByDefinition = new stdClass();
$oRefineByDefinition->sId = 241;
$oRefineByDefinition->sName = '';
$oRefineBy->oRefineByDefinition = $oRefineByDefinition;
$returnedcolumns = array(sAwImageUrl,sDescription,sBrand,iMerchantId, iCategoryId);
$boolean_product_search_params = array("sQuery" => "Only by the Night Kings of Leon", "bHotPick" => false, "iAdult" => 1, "iLimit"=>20, "sColumnToReturn" => $returnedcolumns, "oActiveRefineByGroup" => $oRefineBy, "bIncludeTree" => true, "sMode" => boolean );
$oResponse = $oClient->call('getProductList', $boolean_product_search_params);
foreach($oResponse->oProduct as $search)
{
print $search->sDescription;
}
now im not even sure the above solution will even work with my setup, in other words the values are dynamic and inputted into the system by the user. so its not like i want to display just kings of leon cds it will change with every search a user submits.
if you see what i mean :)
but if i can get it working i can check it out :D
thanks
Luke
ljackson09
27-09-09, 21:23
ok i was being thick lol, i just tried ammending my current code to include another string in the query and 90% of the time its working (well for video game platform) should be straight forward for cd artists and book authors :)
i will post back on my results :)
cheers mate
Luke