Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
longwaveNot really a bug, as the catalog taxonomy is not really designed to be pre-filtered, though I guess this could be useful.
Comment #2
SilviuChingaru CreditAttribution: SilviuChingaru commentedRight 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. ;-)
Comment #3
SilviuChingaru CreditAttribution: SilviuChingaru commentedI'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.
Comment #4
SilviuChingaru CreditAttribution: SilviuChingaru commented