The block should count only selected views products and only categories that, with uc_catalog view filters active, still have products. This should not be to hard to implement if instead to run our custom query:

$query = new EntityFieldQuery();
      $query->entityCondition('entity_type', 'node')
        ->entityCondition('bundle', $types)
        ->propertyCondition('status', 1) // Don't include unpublished products.
        ->fieldCondition('taxonomy_catalog', 'tid', $item->tid)
        ->count();
      $num = $query->execute();

we could get filters from view and maybe build a custom query with that filters that only counts the products instead of render them.

Comments

longwave’s picture

Category: bug » task

Not really a bug, as the catalog taxonomy is not really designed to be pre-filtered, though I guess this could be useful.

SilviuChingaru’s picture

Right now I don't know how to get the view query where conditions so I'm stuck until I figure a way to get those. Does anyone knows how to get where conditions from a view query???

I still think this is a bug because it allow user to filter products but it display a fixed number of products.
What if you have an field for brand on product nodes and you expose that filter to users? They see a lot of products in catalog block but when they click on that category no products to display?!?!

Anyway, it doesn't meter if is a bug or task I think this should be fixed / added. ;-)

SilviuChingaru’s picture

Assigned: Unassigned » SilviuChingaru

I'll look into this too, and hope find a solution, when I'll look into #1810264: Catalog block performance leak when block caching is disabled.

SilviuChingaru’s picture

Assigned: SilviuChingaru » Unassigned
Issue summary: View changes