PDA

View Full Version : Category Tree problem


authcode
25-06-07, 19:13
I've gone back to an old problem that's been bugging me for ages that I just can't figure out. Can anyone see what wrong here?

<?php
if (!defined('HOME_PATH')) {
$sPath= dirname(__FILE__).DIRECTORY_SEPARATOR;
define('HOME_PATH', $sPath);
}

define('USER_ID', ###);
define('USER_PASS', ###);

require_once('includes'.DIRECTORY_SEPARATOR.'class es'.DIRECTORY_SEPARATOR.'class.api_category_tree.p hp');

$oApiCategoryTree = new api_categoryTree();

$oCategoryTreeParams = new stdClass();
$oCategoryTreeParams->iCategoryId=141;
$oCategoryTreeParams->aMerchantIds=array();
$oCategoryTreeParams->sRelationship='all';
$oCategoryTreeParams->iMaxCategories=3;
$oCategoryTreeParams->bIncludeDescendants=true;
$oCategoryTreeParams->bIncludeEmptyCats=true;
$oCategoryTreeParams->bIncludeCounts=true;

$oCategoryTree = $oApiCategoryTree->getCategoryTree($oCategoryTreeParams);

foreach ($oCategoryTree as $oCategory) {
echo $oCategory->sName;
echo '<br />';
}
?>

The output of this is:
Maternity
Women's Dresses & Skirts
Women's Outerwear
Women's Sportswear
Women's Suits
Women's Tops
Women's Trousers

There are a number of problems with this.
1) Category 'Women's Swimwear' is missing.
2) None of the parameters have any effect on the output expect the categoryId and...
3) The relationship parameter which when set to anything other than 'all' returns no categories.

Any ideas as to what's going on?