public function createProductFilterByCategory( $catid, $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' )
	{
		$search = $this->createProductFilterDefault( $sort, $direction, $start, $size, $listtype );
		$expr = array( $search->compare( '==', 'catalog.index.catalog.id', $catid ) );

		if( $sort === 'relevance' )
		{
			$cmpfunc = $search->createFunction( 'catalog.index.catalog.position', array( $listtype, $catid ) );
			$expr[] = $search->compare( '>=', $cmpfunc, 0 );

			$sortfunc = $search->createFunction( 'sort:catalog.index.catalog.position', array( $listtype, $catid ) );
			$search->setSortations( array( $search->sort( $direction, $sortfunc ) ) );
		}

		$expr[] = $search->getConditions();
		$search->setConditions( $search->combine( '&&', $expr ) );

		return $search;
	}
public function createProductFilterByCategory( $catid, $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' )
	{
		$search = $this->createProductFilterDefault( $sort, $direction, $start, $size, $listtype );
		$expr = array( $search->compare( '==', 'catalog.index.catalog.id', $catid ) );

		if( $sort === 'relevance' )
		{
			$cmpfunc = $search->createFunction( 'catalog.index.catalog.position', array( $listtype, $catid ) );
			$expr[] = $search->compare( '>=', $cmpfunc, 0 );

			$sortfunc = $search->createFunction( 'sort:catalog.index.catalog.position', array( $listtype, $catid ) );
			$search->setSortations( array( $search->sort( $direction, $sortfunc ) ) );
		}

		$expr[] = $search->getConditions();
		$search->setConditions( $search->combine( '&&', $expr ) );

		return $search;
	}
public function createProductFilterByCategory ( $ catid , $ sort = null , $ direction = '+' , $ start = 0 , $ size = 100 , $ listtype = 'default' ) { $ search = $ this -> createProductFilterDefault ( $ sort , $ direction , $ start , $ size , $ listtype ) ; $ expr = array ( $ search -> compare ( '==' , 'catalog.index.catalog.id' , $ catid ) ) ; if ( $ sort === 'relevance' ) { $ cmpfunc = $ search -> createFunction ( 'catalog.index.catalog.position' , array ( $ listtype , $ catid ) ) ; $ expr [ ] = $ search -> compare ( '>=' , $ cmpfunc , 0 ) ; $ sortfunc = $ search -> createFunction ( 'sort:catalog.index.catalog.position' , array ( $ listtype , $ catid ) ) ; $ search -> setSortations ( array ( $ search -> sort ( $ direction , $ sortfunc ) ) ) ; } $ expr [ ] = $ search -> getConditions ( ) ; $ search -> setConditions ( $ search -> combine ( '&&' , $ expr ) ) ; return $ search ; }
Returns a product filter for the given category ID.

@param integer $catid ID of the category to get the product list from
@param string|null $sort Sortation of the product list like "name", "code", "price" and "position", null for no sortation
@param string $direction Sort direction of the product list ("+", "-")
@param integer $start Position in the list of found products where to begin retrieving the items
@param integer $size Number of products that should be returned
@param string $listtype Type of the product list, e.g. default, promotion, etc.
@return MW_Common_Criteria_Interface Criteria object containing the conditions for searching
Returns a product filter for the given category ID .