kernel/classes/ezproductcategory.php
static function fetchProductCountByCategory( $categoryID )
    {
        $ini = eZINI::instance( 'shop.ini' );
        if ( !$ini->hasVariable( 'VATSettings', 'ProductCategoryAttribute' ) ||
             !$categoryAttrName = $ini->variable( 'VATSettings', 'ProductCategoryAttribute' ) )
            return 0;

        $db = eZDB::instance();
        $categoryID =(int) $categoryID;
        $categoryAttrName = $db->escapeString( $categoryAttrName );
        $query = "SELECT COUNT(*) AS count " .
                 " FROM ezcontentobject_attribute coa, ezcontentclass_attribute cca, ezcontentobject co " .
                 "WHERE " .
                 " cca.id=coa.contentclassattribute_id " .
                 " AND coa.contentobject_id=co.id " .
                 " AND cca.data_type_string='ezproductcategory' " .
                 " AND cca.identifier='$categoryAttrName' " .
                 " AND coa.version=co.current_version " .
                 " AND coa.data_int=$categoryID";
        $rows = $db->arrayQuery( $query );
        return $rows[0]['count'];
    }
static function fetchProductCountByCategory( $categoryID )
    {
        $ini = eZINI::instance( 'shop.ini' );
        if ( !$ini->hasVariable( 'VATSettings', 'ProductCategoryAttribute' ) ||
             !$categoryAttrName = $ini->variable( 'VATSettings', 'ProductCategoryAttribute' ) )
            return 0;

        $db = eZDB::instance();
        $categoryID =(int) $categoryID;
        $categoryAttrName = $db->escapeString( $categoryAttrName );
        $query = "SELECT COUNT(*) AS count " .
                 " FROM ezcontentobject_attribute coa, ezcontentclass_attribute cca, ezcontentobject co " .
                 "WHERE " .
                 " cca.id=coa.contentclassattribute_id " .
                 " AND coa.contentobject_id=co.id " .
                 " AND cca.data_type_string='ezproductcategory' " .
                 " AND cca.identifier='$categoryAttrName' " .
                 " AND coa.version=co.current_version " .
                 " AND coa.data_int=$categoryID";
        $rows = $db->arrayQuery( $query );
        return $rows[0]['count'];
    }
static function fetchProductCountByCategory ( $ categoryID ) { $ ini = eZINI :: instance ( 'shop.ini' ) ; if ( ! $ ini -> hasVariable ( 'VATSettings' , 'ProductCategoryAttribute' ) || ! $ categoryAttrName = $ ini -> variable ( 'VATSettings' , 'ProductCategoryAttribute' ) ) return 0 ; $ db = eZDB :: instance ( ) ; $ categoryID = ( int ) $ categoryID ; $ categoryAttrName = $ db -> escapeString ( $ categoryAttrName ) ; $ query = "SELECT COUNT(*) AS count " . " FROM ezcontentobject_attribute coa, ezcontentclass_attribute cca, ezcontentobject co " . "WHERE " . " cca.id=coa.contentclassattribute_id " . " AND coa.contentobject_id=co.id " . " AND cca.data_type_string='ezproductcategory' " . " AND cca.identifier='$categoryAttrName' " . " AND coa.version=co.current_version " . " AND coa.data_int=$categoryID" ; $ rows = $ db -> arrayQuery ( $ query ) ; return $ rows [ 0 ] [ 'count' ] ; }
Returns number of products belonging to the given category.

\public
\static
Returns number of products belonging to the given category .