PDA

View Full Version : RefineBy Request


currentstyle
20-02-09, 13:12
Hi, I'm trying to refineby two criteria and seem to be coming up against a problem, I've read the documentation, tried a hundred different ways to do it and I still find that i can only refineby one criteria at a time, heres the code I'm using;

$oRefineBy = new stdClass();
$oRefineBy -> iId = 3;
$oRefineBy -> sName = 'Merchant';
$oRefineByDefinition = new stdClass();
$oRefineByDefinition -> sId = 1203;
$oRefineByDefinition -> sName = '';
$oRefineBy -> oRefineByDefinition = $oRefineByDefinition;

$oRefineBy2 = new stdClass();
$oRefineBy2 -> iId = 4;
$oRefineBy2 -> sName = 'Category';
$oRefineByDefinition2 = new stdClass();
$oRefineByDefinition2 -> sId = 540;
$oRefineByDefinition2 -> sName = '';
$oRefineBy2 -> oRefineByDefinition = $oRefineByDefinition2;


$refinebyparams= array($oRefineBy,$oRefineBy2);

$callparams = array("iLimit"=>24, "oActiveRefineByGroup" => $refinebyparams);

:confused: Its not working, or, more to the point, it is working, but its only refining by the first refineby, ie. merchant.

Anyone offer any help on this?

Ollie
20-02-09, 14:25
Hi there.

Your refine bys look fine. I would suggest adding in "bIncludeTree" => true to your call as there are no products available in category 540 for merchant 1203.

If you do this, then the API response will include child category's within your search results.

Cheers

currentstyle
20-02-09, 14:42
Thanks Ollie, the 'bIncludeTree' did the job nicely :D