PDA

View Full Version : Refine by multiply objects?


84585
21-01-09, 14:15
Hi i am currently developing a shop using the shop window API,

i am having trouble refining by multiply objects.

According to information read this can be done by simply placing each refined object in an array and passing this to the query method. Please see:

// Refine by price (1)
$oRefineBy = new stdClass();
$oRefineBy->iId = 1;
$oRefineBy->sName = 'Price';
$oRefineByDefinition = new stdClass();
$oRefineByDefinition->sId = $priceID;
$oRefineByDefinition->sName = '';
$oRefineBy->oRefineByDefinition = $oRefineByDefinition;

// Refine by Category (4)
$oRefineBy2 = new stdClass();
$oRefineBy2->iId = 4;
$oRefineBy2->sName = 'Category';
$oRefineByDefinition2 = new stdClass();
$oRefineByDefinition2->sId = $categoryID;
$oRefineByDefinition2->sName = $categoryName;
$oRefineBy2->oRefineByDefinition = $oRefineByDefinition2;

$oProductDisplayListParams -> oActiveRefineByGroup = array( $oRefineBy, $oRefineBy2 );

$aParams = array("iLimit" => 10, "bExpandAllBranches" => true, "bAdult" => false, "oActiveRefineByGroup" => $oProductDisplayListParams);

# API Call Examples #
$oResponse= $oClient->call('getProductList', $aParams);


Any ideas on what i am missin gor doing wrong?

Ollie
21-01-09, 15:04
Hi there,

At this time you are unable to refine by more than one value.

Cheers

84585
21-01-09, 15:27
Hi there,

At this time you are unable to refine by more than one value.

Cheers
Is this problem one that is under active development, or is it a limitation to which version of the API i use?

It definatly lmiits the usability of the API and reduces the functionality possible.

Ollie
21-01-09, 15:36
Whoops. I massively mis-understood what you were doing. :(

Sorry,

Yes you can have multiple refine by items. But, you cannot have multiple refine by definitions.

You are almost there, but you need to change the line:
$oProductDisplayListParams -> oActiveRefineByGroup = array( $oRefineBy, $oRefineBy2 );

to

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

Cheers